Error msg: Failed to convert parameter value from a String to a Boolean
I am getting an error msg when attempting to update a record from asp.net into a SQL database. The only boolean value开发者_开发百科 being updated is:
cmdAddUser.Parameters.Add(new SqlParameter("@Active", SqlDbType.Bit));
cmdAddUser.Parameters["@Active"].Value =
Convert.ToBoolean(cbAddUserActiveUser.Checked);
The datatype for @Active in the database is "bit". Any ideas?
Long shot - have you got another parameter that is set as a string but is a bit column in the actual table?
精彩评论