sqldatasource help

sqldatasource help

am 17.01.2008 00:51:00 von rodchar

hey all,
can someone please help me get the following snippet work?

protected void BtnSearch_Click(object sender, EventArgs e)
{
SqlDataSource4.SelectParameters.Add("@FirstName", TextBox1.Text);
SqlDataSource4.Select(DataSourceSelectArguments.Empty);
GridView1.DataSourceID = "SqlDataSource4";
GridView1.DataBind();
}
i'm not getting any results back.

thanks,
rodchar

Re: sqldatasource help

am 17.01.2008 02:43:51 von Alvin Bruney

Start here.
http://msdn2.microsoft.com/en-us/library/system.data.sqlclie nt.sqlcommand.parameters(VS.71).aspx
You might just want to try testing the number of rows that were returned, I
suspect there are zero rows returned.
--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The O.W.C. Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $19.99
-------------------------------------------------------



"rodchar" wrote in message
news:B553F3FF-9D0E-45AD-B456-9B7A96C2EFC0@microsoft.com...
> hey all,
> can someone please help me get the following snippet work?
>
> protected void BtnSearch_Click(object sender, EventArgs e)
> {
> SqlDataSource4.SelectParameters.Add("@FirstName", TextBox1.Text);
> SqlDataSource4.Select(DataSourceSelectArguments.Empty);
> GridView1.DataSourceID = "SqlDataSource4";
> GridView1.DataBind();
> }
> i'm not getting any results back.
>
> thanks,
> rodchar