Insert null value

C

Chris

I´m working with SQLCE 3.0, WM5, CF 2.0 and with resultSet. In my table 'Table_1' i have a column int that accept null values.
My question is how to update that column with a null value, i didn´t find a way to do it with the resultset...

Can anybody help me ?

Thanks in advance.
Chris
 
J

Jin Chang

I´m working with SQLCE 3.0, WM5, CF 2.0 and with resultSet. In my table 'Table_1' i have a column int that accept null values.
My question is how to update that column with a null value, i didn´t find a way to do it with the resultset...

Can anybody help me ?

Thanks in advance.
Chris

You can assign it the DBNull.Value.

- Jin
 
C

Chris

Hi Jin, thanks for your reply, i write this:

myresultSet.SetInt32(2, DBNull.Value);

but i get this error: Error 6 Argument '2': cannot convert from
'System.DBNull' to 'int'

My column is int, and accept null values.... Can you help me ?

Thanks a lot Jin







"Jin Chang" <[email protected]> escribió en el mensaje
I´m working with SQLCE 3.0, WM5, CF 2.0 and with resultSet. In my table
'Table_1' i have a column int that accept null values.
My question is how to update that column with a null value, i didn´t find
a way to do it with the resultset...

Can anybody help me ?

Thanks in advance.
Chris

You can assign it the DBNull.Value.

- Jin
 
C

Chris

Sorry, i found the correct syntax:
myresultSet.SetValue(2, DBNull.Value);

Thanks for your help Jin!!, it´s works!
 

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