I\'m trying to read from mysql field with datetime type and I was trying everything and always it\'s return field name only.
Here is my code:
using (MySq
Use
dataReader.GetDateTime(dataReader.GetOrdinal("sDate"))
instead of
dataReader["sDate"] + ""
and remove the ticks around your columns in the sql, e.g.
sDate
instead of 'sDate'
. You need them only for reserved words or if you have spaces in your column names:
9.3. Reserved Words
2.2. Reserved Words in MySQL 5.1