F
Finn Stampe Mikkelsen
Hi
I have defined a table in my database, with 2 date-fields. I have set a
default value to DBNull. I have integrated a nullable datetimepicker control
to my project and set the apropriate NullValue in my datagridview...
Everything works great, with a table-row added manually to the database,
without setting any value to the second date-field. Both the datagridview
and the datetimepicker displays correctly the DBNull value..
My problem however is, how do i add a new row in my program, setting one
date to an actual date, but leaving the other un-set and thereby leaving it
to the DBNull i have setup in the table-design??
When using the addrow method of the dataset i have tried with the field
represented as 'Nothing' but this does not leave the field set to DBNull in
the DB but to a date of 30. december 1899...
Using DBNull.value does not work, but generates an error... How do i add a
new row to my table, leaving one of my date fields un-set (left to
DBNull)???
/Finn
I have defined a table in my database, with 2 date-fields. I have set a
default value to DBNull. I have integrated a nullable datetimepicker control
to my project and set the apropriate NullValue in my datagridview...
Everything works great, with a table-row added manually to the database,
without setting any value to the second date-field. Both the datagridview
and the datetimepicker displays correctly the DBNull value..
My problem however is, how do i add a new row in my program, setting one
date to an actual date, but leaving the other un-set and thereby leaving it
to the DBNull i have setup in the table-design??
When using the addrow method of the dataset i have tried with the field
represented as 'Nothing' but this does not leave the field set to DBNull in
the DB but to a date of 30. december 1899...
Using DBNull.value does not work, but generates an error... How do i add a
new row to my table, leaving one of my date fields un-set (left to
DBNull)???
/Finn