Last post Nov 25, 2010 01:49 AM by Wencui Qian - MSFT
Nov 22, 2010 03:09 AM|BrotherBewar|LINK
Hi everybody, first of all i'd like to thank everyone on the asp.net forum for all the knowledge they share, you guys have helped me alot! Thank you!
Now to the problem,
Is it possible to get DefaultValue in a parameter from another SQLDataSource, for example, i have this
<asp:SqlDataSource ID="SportsEngineSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [TabMainCategoryDictionaryID] WHERE (([LanguageID] = @LanguageID) AND ([MainCategoryID] = @MainCategoryID))">
<asp:QueryStringParameter DefaultValue="2" Name="LanguageID" QueryStringField="lng" Type="Int32" />
<asp:Parameter DefaultValue="8" Name="MainCategoryID" Type="Int32" />
And i want the DefaulValue (DefaultValue="8") to get its value from another SQLDataSource not much different from the example above. Any help would be appreciated, thank you!
sql parameter defaultvalue
Nov 22, 2010 04:06 AM|Ahmed Moosa|LINK
what do you mean about "another SQLDataSorce ? what you need to get from ?
Nov 22, 2010 04:19 AM|BrotherBewar|LINK
Hi, just anther SQLDataSource in the page, lets say i want the default value for (MainCategoryID) in SQLDataSorce1 to be something taken from (ArticleCategoryID) from SQLDataSource2.
i could just use a simple querystring but i was wondering if this method is possible, and if so, how?
Nov 25, 2010 01:49 AM|Wencui Qian - MSFT|LINK
I think you can try to get it like this in Selecting event: