1) When using a stored procedure, using a command object and parameters like the following:
(pVotes is an unsigned mediumint in MySql)
Code: Select all
oCommand.Parameters.Add("pVotes", 0);
Code: Select all
oCommand.Parameters.Add("pVotes", "0");
or
Code: Select all
MySqlParameter oMySqlParameter = new MySqlParameter("pVotes", MySqlType.Int);
oMySqlParameter.Value = 0;
This is addressed on these forums in this post:
http://www.crlab.com/forums/viewtopic.php?t=9104
Desired Solution:
I would like to simply have another constructor overloaded for MySqlParameter that accepts the "parameterName", "dbType", and "value"
So that I can do the following:
Code: Select all
oCommand.Parameters.Add("pVotes", MySqlType.Int, 0);
or
oCommand.Parameters.Add(new MySqlParameter("pVotes", MySqlType.Int, 0) );
What are the performance differences between letting the Server handle the type conversions versus passing the correct data types from the c# codebehind?
I'm assuming giving the server the correct datatypes is the desired method.
Thanks!