等同于SqlDbType.Bit的DbType [英] DbType equivalent to SqlDbType.Bit

查看:82
本文介绍了等同于SqlDbType.Bit的DbType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道SqlDbType.Bit的DbType是什么吗?

Does anyone know what is the DbType equivalent to SqlDbType.Bit?

我正在尝试转换

param[0] = new SqlParameter("@Status", SqlDbType.Bit);
param[0].Value = Status;

db.AddInParameter(dbCommand, "@Status", <DbType dbType>, Status);

但是我不知道用哪个DbType来表示单个位.有什么想法吗?

but I don't know which DbType to use to represent a single Bit. Any ideas?

推荐答案

数据库类型 bit 在服务器端表示为布尔值,因此相应的 DbType 值是 DbType.Boolean .

The database type bit is represented as a boolean on the server side, so the corresponding DbType value is DbType.Boolean.

这篇关于等同于SqlDbType.Bit的DbType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆