Click here to Skip to main content
15,920,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have Student Attendance Excel in Which I filling attendance detail of student at last of month I upload that excel sheet in database.When uploading excel sheet I getting this error
C#
Error Uploading all Records.Object reference not set to an instance of an object
Posted
Comments
phil.o 23-Dec-15 3:08am    
The issue in the title does not match the error message.
Please improve your question and give relevant details, including the code block that is throwing the exception. Do not post code in comments; please press the "Improve question" button instead.

1 solution

Function SQLDate(d)
SQLDate = WorksheetFunction.Text(d, "yyyy-mm-dd hh:MM:ss")
End Function


or else

if staging table is an option, you could convert Excel date to string using
TEXT(d,"dd mmmm yyyy hh:mm:ss"). once the data is in staging table, you may write appropriate SQL statement to insert into correct table.
 
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