aspx.vb SqlDataSource

P

prontoo

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
 
A

agapeton

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/
 
P

prontoo

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.


(e-mail address removed) напиша:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top