Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   aspx.vb SqlDataSource (http://www.velocityreviews.com/forums/t114891-aspx-vb-sqldatasource.html)

prontoo 12-05-2005 06:52 PM

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


agapeton@gmail.com 12-06-2005 01:01 AM

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/


prontoo 12-10-2005 05:54 PM

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 06:48 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.