When creating a parameter e.g. to be used in an INSERT statement, the short version is to just specify the parameterName and an value-object e.g.
DBCMD.Parameters.AddWithValue("@date", MyDateOject)
But can I trust the .Net MySQL connector will correctly convert the data saved in the MyDataObject to the right MySqlDbType used in the target table field?
Lets say MyDateOject have a value of .Net DateTime and the target field is MySqlDbType.Date (have no time)....will that work?
And will boolean be converted correctly if target field is MySqlDbType.Bit(1)
I know I can construct the parameter setting the MySqlDbType explicit but if I can trust the "automatic" conversion that would be the easiest way.
DBCMD.Parameters.AddWithValue("@date", MyDateOject)
But can I trust the .Net MySQL connector will correctly convert the data saved in the MyDataObject to the right MySqlDbType used in the target table field?
Lets say MyDateOject have a value of .Net DateTime and the target field is MySqlDbType.Date (have no time)....will that work?
And will boolean be converted correctly if target field is MySqlDbType.Bit(1)
I know I can construct the parameter setting the MySqlDbType explicit but if I can trust the "automatic" conversion that would be the easiest way.