2
Answers

c# search inbox is not workin.

Photo of Aditya Mote

Aditya Mote

4y
544
1
text box is not able to show the result in grid view, can you please help me?
 
on click text box code :-
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
con = new SqlConnection(connectionstring);
con.Open();
adapt = new SqlDataAdapter("select * from table where product like '" + TextBox1.Text + "%'", con);
dtsdf = new DataTable();
adapt.Fill(dtsdf);
gvContact1.DataSource = dtsdf;
con.Close();
}
 
Search box :-
<asp:Label ID="search" runat="server" Text="search" ></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
 
 

Answers (2)