PDA

View Full Version : متد get.values در datareader



mohammad_cmd
پنج شنبه 06 مرداد 1390, 20:11 عصر
سلام دوستان . من این خط کد رو تو برنامه ام می نویسم ولی برنام هنگ می کنه. راهنمایی کنید.
SqlCommand cm3 = new SqlCommand();
cm3.CommandText = "select sh_h from person_3 where sh_k = '" + comboBox1.Text + "' and person_3.date between '" + maskedTextBox1.Text + "' and '" + maskedTextBox3.Text + "'";
cm3.Connection = cn;
SqlDataReader dr3;
dr3 = cm3.ExecuteReader();
comboBox2.Items.Clear();
while (dr3.Read())
{
comboBox2.Items.Add(dr3.GetValues(1).ToString());
}