description:
assigning a string to a DbCommand parameter blob field gives an error at execution
 
error:
unable to cast object of type 'System.String' to type 'System.Byte[]'.
 
example:
parameter = provider.CreateParameter();
parameter.Value = textBoxDescription.Text;
parameter.DbType = DbType.String;
parameter.ParameterName = "@description"; // @description = blob field
command.Parameters.Add(parameter);
 
command.Prepare();
command.ExecuteNonQuery();  // exception is thrown!!

Reply via email to