Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

Am unable to insert record where there is null values for numeric data in Access DB.
I have approximately 58 fields and 500 records.

Is there any possible way to do the insert?

Many Thanks

Shaheen
Posted

1 solution

You can only insert a null value into a field if that field is nullable. If it is not nullable, you have two choices; change the column type so that it can be null; insert a sentinel value such as int.MinValue to simulate this and act on the data to convert it to a null on the way out.

When you insert, you supply a DBNull to add null into the column.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900