Click here to Skip to main content
15,913,722 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to allow the null value in the SQl through the Application .Hi all I import the excel file in data grid view. In the excel file having Records in date and time format, if any cell of record is null how to save the record, while I am save the record it’s showing the Error “String was not recognized as a valid Date Time”
Posted
Comments
Mantu Singh 5-Feb-13 3:34am    
are null values allowed on the date column of the database..........

Use DBNull.Value. This will insert the null value wherever required.
 
Share this answer
 
In page wise you check the condition

C#
if(excel_col == "NULL")
   // passign "null" as a parameter in that 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