5
Answers

Some time the same message. Need to resolv...

Israel

Israel

8y
257
1
Hi,
I wrote these codes but why some time I receive this message and how can to resolv it please forever:
The connection was not closed. The connection's current state is open. 
 
conn.Open();
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "select * from cadastramento order by ID";
cmd.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(dt);
conn.Close();
dGVCons.DataSource = dt;
dGVCons.CurrentCell = dGVCons.Rows[dGVCons.Rows.Count - 1].Cells[0];
 
Answers (5)