Asked By Finn Stampe Mikkelsen
11-Jul-07 10:23 AM

Hi
I have been to the table-design and set the default value to be Null. I
can't seem to find any way to pass the null value to the DB.
The field is a Date field. I can't pass DBNull.value, i have tried VB's
Nothing reference but it passes a value leaving the datefield set to dec.
30., 1899... i can't pass "" and i can't ommit the field in the addrow
method...
So i can't seem to find a way that i can do that...
Here's my code
Kunder.Arbejdsopgaver.AddArbejdsopgaverRow(ArbejdsNummerTextBox.Text,
StolTypeTextBox.Text, _ Kunder._Kunder.Rows(KunderBindingSource.Position) ,
DatoStartDateTimePicker.Value, DatoSlutDateTimePicker.Value)
It's the last field (DatoSlutDateTimePicker.Value) i need to pass to the DB
as a null value, since it depick's a date marking the end of a project. This
date is not set, when creating a project and logically should be set to
null..
I have worked around the DBNull problem with DateTimePicker and created a
control handling this and my column in my DataGridView is setup to show the
NullValue with the correct text..
Now i can't seem to create the project by adding a new row, passing this
DBNull value in the field...
/Finn