Convert Date MMDDYY to Date for database Insert
- by lesponce
I got an array with a date set as 071712 . no / slash characters for the date, no dash. nothing, just plain 071712 (coming from a text file).
I need to convert the date so I can include it in a SqlServer insert statement. I'm calling a stored procedure for the insert. So far I have this:
// This is not working so far.
DateTime date = Convert.ToDateTime(fileLines[4]);
(date will be used as a parm for the stored procedure)