hi every one,
am creating search option in my project , the project which was done by c# windows application,
my search flow is,
i have one text box and one button,
when i type table relevant field in the text box its direclty get it from my database and display one datagrid view,
please see my code below where i did mistake, please let me know,
private void btnsearch_Click(object sender, EventArgs e)
{
try
{
con = new SqlConnection(s);
con.Open();
cmd = new SqlCommand("select * from RateSheets where Destinations='" + txtbrowse.Text + "'", con);
cmd.ExecuteNonQuery();
da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
thanks in advance...