Object cannot be cast from DBNull to other types while opening a connection to Mysql in C#

79 Views Asked by At
Line 27: try
Line 28: {
Line 29:     Conn.Open();
Line 30:     MySqlReader = cmd.ExecuteReader();
Line 31:     if (MySqlReader.Read() == true)

I tried changing Mysql.dll, and added a reference to the web config, but it didn't work. I'm getting this error while opening a connection:

'Line 29: Conn.Open();'

0

There are 0 best solutions below