dataset's NULL value

G

Guest

Hi,

I just installed Visual Studio 2005.
In VS 2003, if a field's NullValue in a data table is set to -1, I can
assign it -1 in code as NULL value.
But in VS 2005, look like the data table doesn't take -1 as NULL value
although property NullValue = -1. it takes it as a normal value and check
table relationship to see if it's in primary key table.

I saw in 2005 property DefaultValue is set to <DBNull>. I don't care this
property but <DBNull> make me think that 2005 may use <DBNull> as Null value
no matter what the NullValue is. NullValue is only used to return (get), not
for assign (set).

If it's the case, what's the easy way to fix it? Can I just modify some
property settings or I have to change my codes anywhere there is a -1
assignment?

Thanks.

Li
 
K

Kevin Yu [MSFT]

Hi Li,

I think there might be some misunderstanding on DefaultValue and NullValue
here.

DefaultValue means when creatting a new row, the DataSet use DefaultValue
as the value for the column in the newly created row. While NullValue means
if the value of this column is null, the DataSet returns the NullValue when
the value stored in this field is actully DBNull.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top