Home All Groups Group Topic Archive Search About

AllowDBNull in DataTables

Author
31 Mar 2006 2:19 PM
elziko
I use a data adapter to fill a DataTable (that contains no row or columns)
with data from a table in my SQL Server Express database.

The columns that the DataAdapter creates in my DataTable all have the
correct datatype but each is created so that AllowDBNull = True. However,
the table in the SSE Database has columns where NULLs are not allowed.

Any idea why this information isn't making it from teh database to the
DataTable?

Whats more, if I try and change the change the columns in the DataTable
myself after the Fill() method is called, setting AllowDBNull = True seems
to have no effect. Why would this be?

TIA

Author
1 Apr 2006 2:22 AM
Elton W
Hi elziko,

DataAdapter basically only retrieves data and data type, and set
column'AllowDBNull to default true. You can change it to not allow null value
(false).

HTH

Elton Wang 

Show quote
"elziko" wrote:

> I use a data adapter to fill a DataTable (that contains no row or columns)
> with data from a table in my SQL Server Express database.
>
> The columns that the DataAdapter creates in my DataTable all have the
> correct datatype but each is created so that AllowDBNull = True. However,
> the table in the SSE Database has columns where NULLs are not allowed.
>
> Any idea why this information isn't making it from teh database to the
> DataTable?
>
> Whats more, if I try and change the change the columns in the DataTable
> myself after the Fill() method is called, setting AllowDBNull = True seems
> to have no effect. Why would this be?
>
> TIA
>
>
>

AddThis Social Bookmark Button