I want to pass multiple select queary to datareader. how to do it.
I know how to pass queary for one condition :
SqlConnection cn = new SqlConnection();
cn.ConnectionString = "";
cn.Open();
SqlCommand cmd = new SqlCommand();
SqlDataReader rdr;
string s = "select * from abc where id like@find";
cmd = new SqlCommand(s);
cmd.Parameters.Add(new SqlParameter("@find", System.Data.SqlDbType.VarChar, 20, "find"));
cmd.Parameters["@find"].Value = textBox1.Text;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
comboBox1.Items.Add(rdr["id"].ToString());
}
rdr.Close();
program should check for name if id and name both are correct then data display in combobox.
thanks........