searh ??? textbox1 and gridview :)

Last post 05-15-2008 8:43 AM by oguzkaygun. 15 replies.

Sort Posts:

  • Re: searh ??? textbox1 and gridview :)

    05-15-2008, 8:43 AM

    hello

    thank you for your answer :)

    my lastly code is below.. there is no error.. it is run but when i write Chai to textbox1.text and i click button, i dont see any record in gridview :) Chai is producname and it is in prouducts :)

    what can problem be ?

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Dim SglDataSource2 As New SqlDataSource()

    SglDataSource2.ConnectionString = ConfigurationManager.ConnectionStrings("NORTHWNDConnectionString").ToString

    SglDataSource2.SelectCommandType = SqlDataSourceCommandType.Text

    SglDataSource2.SelectCommand = "SELECT * FROM products WHERE ProductName=@ProductName"

    SglDataSource2.SelectParameters.Add("@ProductName", TextBox1.Text)

    GridView1.DataSourceID = SglDataSource2.ID

    GridView1.DataBind()

    End Sub

    Mark as me if my question or my answer can be helpful for you :)
Page 2 of 2 (16 items) < Previous 1 2