private void button5_Click(object sender, EventArgs e)
{
con = new SqlConnection(@"Data Source=abbas-PC\SQLEXPRESS;Initial Catalog=EREGISTRY;Integrated Security=True");
ds = new DataSet();
cmd = new SqlCommand("select * from REGISTRY where CUSTUMER=@CUSTUMER and DATE=@DATE",con);
cmd.Parameters.Add("CUSTUMER", SqlDbType.NVarChar, 40).Value = textBox6.Text;
cmd.Parameters.Add("DATE", SqlDbType.NVarChar, 20).Value = dateTimePicker2.Value;
da = new SqlDataAdapter(cmd);
con.Open();
da.Fill(ds, "reg");
con.Close();
dataGridView1.DataSource = ds.Tables[0];