Code:
SqlConnection con = new SqlConnection(cn.getcon()); if (con.State == ConnectionState.Open) con.Close(); con.Open(); SqlCommand cmd; SqlCommand cmd1; SqlDataAdapter dr1; SqlDataAdapter dr; cmd = new SqlCommand("select * from sabha00a where s00a0004<='" + A00D0001.Value.ToString("yyyy-MM-dd") + "'",con); dr=cmd.ExecuteReader(); while (dr.Read()) { cmd1 = new SqlCommand("select * from milka00b where a00b0002=" + dr[0].ToString() + "",con); dr1 = cmd1.ExecuteReader(); } con.Close();
Exception := Datareader already opened
I found this error in while loop. Please give me the solution for this error...
Comment