Given key was not present in dictionary in MySql Select statement

372 Views Asked by At

My connection is as follow:

string conString = "server = 10.10.76.150; user id = root1; port 3306; password = root1; charset = utf8";
MySqlConnection conn = new MySqlConnection(conString);
conn.Open();

When I insert some data into table, values are inserted successfully. But when I run Select * query, it gives me exception as "Given key was not present in the dictionary at cmd.ExecuteReader"

string sqlString = "Select * from table1";
MySqlDataCommand cmd = new MySqlCommand(sqlString, conn);
MySqlDataReader rdr = cmd.ExecuteReader();
0

There are 0 best solutions below