sqldatasource help

Discussion in 'ASP .Net' started by rodchar, Jan 16, 2008.

  1. rodchar

    rodchar Guest

    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
    rodchar, Jan 16, 2008
    #1
    1. Advertising

  2. Start here.
    http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.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:...
    > 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
    Alvin Bruney [ASP.NET MVP], Jan 17, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krish

    GridView SqlDataSource Help

    Krish, Jan 29, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    544
    Krish
    Jan 30, 2006
  2. Raja
    Replies:
    2
    Views:
    461
    Ed Hinton
    Mar 14, 2008
  3. Guest
    Replies:
    0
    Views:
    468
    Guest
    Oct 25, 2006
  4. Brad Isaacs
    Replies:
    0
    Views:
    318
    Brad Isaacs
    Jan 30, 2007
  5. Dave
    Replies:
    2
    Views:
    288
Loading...

Share This Page