boolean to bit when adding a column to a DataTable  
Author Message
rwbogosian





PostPosted: .NET Framework Data Access and Storage, boolean to bit when adding a column to a DataTable Top

Since SQL Server 2005 doesn't have a boolean type it is common to use the bit type when creating new columns in a table. However, the following vb8 code to add a column to a DataTable results in an error (i.e., can't convert boolean to bit). How does one does this

MyTable.Columns.Add("MyBitField", Type.GetType("System.Boolean"))



.NET Development21  
 
 
rwbogosian





PostPosted: .NET Framework Data Access and Storage, boolean to bit when adding a column to a DataTable Top

Since no one seems to know the answer to this question, I will move it to the VB forum.
 
 
CommonGenius.com





PostPosted: .NET Framework Data Access and Storage, boolean to bit when adding a column to a DataTable Top

I get no error using that code. In fact, I work with SQL Server all the time, 2000 and 2005, and my bit fields are always returned as Boolean columns. At what point are you getting an error, and exactly what does it say