Search code examples
c#enterprise-libraryenterprise-library-5sqldbtypedbtype

DbType equivalent to SqlDbType.Bit


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

I am trying to convert

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

to

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

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


Solution

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