hi every one am coming back again here for that i need your help
i have data in a datalist view and i want to put a textbox above that datalist view so that if the use type for search something in that datalist view the datalist will display what he want in that datalist view if it is available . THANKS SO MUCH
Loading
modeste modestePosted Jul 5, 2013, 3:15 PM
Sanjeeb LenkaPosted Jul 5, 2013, 2:07 PM
private void BindData()
{
SqlConnection Con = new SqlConnection("your connectionstring");
if(textbox1.Text==string.Empty)
SqlCommand cmd = new SqlCommand("select * from Depttable ", con);
else
SqlCommand cmd = new SqlCommand("select * from Depttable where id= '" + textBox1.Text + "'", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
dtalist1.DataSource = ds;
dtalist1.DataBind();
}
then call this method in your search button click event
this is a sample code if any doubt reply