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];

Bikesh SrivastavaRank #108 · 20.3K reputationPosted Nov 7, 2016, 6:01 PM EST
Prakash KumarRank #1,799 · 828 reputationPosted Nov 7, 2016, 6:10 PM EST
IsraelRank #1,223 · 1.5K reputationPosted Nov 7, 2016, 8:07 PM EST
Manas MohapatraRank #182 · 13.2K reputationPosted Nov 7, 2016, 8:45 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Nov 7, 2016, 10:33 PM EST