Hi,
In my insert statement I have the following code;
Reason: To insert a NULL value inacse the date was not inserted and the textbox is blank.
At runtime and insert function called - and the textbox is empty it inserts to the table a 01/01/01/ 00:00:00 datetime.
Now, as a test I removed the NOT infront of IsNothing and entered a date to the textbox and insert function called.
Result: It inserrted a NULL value to the table at the backend..
Now, it appears the NOT is not forcing the NULL value to be inserted if blank to the database..
Any help and suggestions pls...
Thanks
In my insert statement I have the following code;
Code:
.AddWithValue("@LicenceEffectiveDate", IIf(Not IsNothing(txtliceffdate.Text), txtliceffdate.Text, DBNull.Value))At runtime and insert function called - and the textbox is empty it inserts to the table a 01/01/01/ 00:00:00 datetime.
Now, as a test I removed the NOT infront of IsNothing and entered a date to the textbox and insert function called.
Result: It inserrted a NULL value to the table at the backend..
Now, it appears the NOT is not forcing the NULL value to be inserted if blank to the database..
Any help and suggestions pls...
Thanks