invalid type cast in MySQLDataReader.cs
Status: Beta
Brought to you by:
cwienands
When trying to use the data reader i.e. like this:
string myString = myReader[ColumnName].ToString()
where ColumName is a string containing the column
name I get a type casting error.
I was able to make it work by changing line 276 in
MySQLDataReader.cs from
public int GetOrdinal(string strColName) { return
(int) m_objFieldNames[strColName]; }
to
public int GetOrdinal(string strColName) { return
Convert.ToInt32(m_objFieldNames[strColName]); }.
Logged In: YES
user_id=628447
Hi Matthias,
thanks, I will take care of it.
Christoph