开发者

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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜