MS SQL and .NET Typed Dataset AllowDBNull Metadata

Posted by Christian Pena on Stack Overflow See other posts from Stack Overflow or by Christian Pena
Published on 2010-03-29T18:30:19Z Indexed on 2010/03/29 18:33 UTC
Read the original article Hit count: 382

Good afternoon,

I am generating a typed dataset from a stored procedure. The stored procedure may contain something like:

select t1.colA, t2.colA AS t2colA 
from t1 
  inner join t2 
    on t1.key = t2.key 

When I generate the typed dataset, the dataset knows whether t1.colA allows NULLs, but it always puts FALSE in AllowDBNull for t2.colA even if t2.colA allows NULL.

Is this because the column is aliased? Is there any way, from SQL, to hint to VS that the column allows NULL? We currently have to go in and update the column's AllowDBNull if we regenerate the table.

Thanks in advance.

Christian

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about strongly-typed-dataset