Aditya Mote

Aditya Mote

  • NA
  • 9
  • 484

c# search inbox is not workin.

Jun 23 2020 9:57 AM
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)