How do I read a date from SQL Server to a datetime
variable in C# ?
DateTime sDate = (read["notDate"]);
I get error
Cannot convert object to a system.datetime [are you missing a cast?]
Edit: the SQL Server uses a Date
datatype for this column.
Then how will format the sDate
to UK format - I was looking at
format("dd/MM/yyyy")
Using ASP.NET, C#, SQL Server Express.
Thanks for your help.
DateTime sDate = (DateTime)read["notDate"];
The format has nothing to do with anything at this point. The format is only for display purposes (or parsing). – itsme86 Jul 12 '18 at 20:22read
? – Erik Philips Jul 12 '18 at 20:42