I don't know what is the correct syntax for adding more columns to the WHERE
clause of my SELECT
statement.
(department is one of the fields I want to add and one other one.)
protected void Button1_Click1(object sender, EventArgs e)
{
try
{
con.Open();
query = "select * from table_1 where Department = '" + DDl_Dep.SelectedItem.ToString() + "'";
cmd = new SqlCommand(query, con);
da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
Gview.DataSource = ds;
Gview.DataBind();
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}