![]() |
aspx.vb SqlDataSource
Hello,
I dont know how to get a recordset from sqldatasource with selectcommand and put in standard listbox (not html) when i press the standard button. Thank you |
Re: aspx.vb SqlDataSource
Not sure what not HTML means or what standard button means, but...
You can think of the .NET 2.0 data sources controls as being akin to the select statements themselves. That is, you "hit go" and BAM something happens. If you want automatical binding all you have to do is this... <asp:ListBox ID="lstMyStuff" runat="server" DataSourceID="sdsMyStuff" DataTextField="Something" DataValueField="SomethingElse"></asp:ListBox> <asp:SqlDataSource id="sdsMyStuff" runat="server" SelectCommand="select * from..."></asp:SqlDataSource> If you want this to be on demand, do the same with lstMyStuff.DataBind( ) in the code behind. If you don't want the list to show until button, have this in the code behind. lstMyStuff.Visible = true lstMyStuff.DataBind( ) with the list set to Visible="false" in the declarative code. David Betz http://www.davidbetz.net/dynamicbliss/ http://www.davidbetz.net/winfx/ |
Re: aspx.vb SqlDataSource
Thank you it's work. But I have one question more. How kan I change the
selectcommand on sqldatasource from standard (not html) button on event click. Thank you once again. agapeton@gmail.com напиша: > Not sure what not HTML means or what standard button means, but... > > You can think of the .NET 2.0 data sources controls as being akin to > the select statements themselves. That is, you "hit go" and BAM > something happens. > > If you want automatical binding all you have to do is this... > > <asp:ListBox ID="lstMyStuff" runat="server" > DataSourceID="sdsMyStuff" DataTextField="Something" > DataValueField="SomethingElse"></asp:ListBox> > <asp:SqlDataSource id="sdsMyStuff" runat="server" > SelectCommand="select * from..."></asp:SqlDataSource> > > > If you want this to be on demand, do the same with > lstMyStuff.DataBind( ) in the code behind. > > If you don't want the list to show until button, have this in the code > behind. > > lstMyStuff.Visible = true > lstMyStuff.DataBind( ) > > with the list set to Visible="false" in the declarative code. > > David Betz > http://www.davidbetz.net/dynamicbliss/ > http://www.davidbetz.net/winfx/ |
| All times are GMT. The time now is 05:04 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.