开发者

Error msg: Failed to convert parameter value from a String to a Boolean

开发者 https://www.devze.com 2023-01-04 20:01 出处:网络
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:

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消