I have a web project working perfecly on my web server and on my local machine.
I sign up on another server provider because I need to migrate my application to a better place, and when I run my application I am receiving this error message:
the conversion of a varchar data type to a datetime data type resulted in an out-of-range value
But I don’t receive this error locally nor on the other server, so I thought it would be some SQL configuration, sadly this error just occur on the code, when I run query on the database, it works perfectly. So I don’t really know what to do at all!
I think its got to be the C# .net configuration but I have no clue where to start.
Since the application is working on everywhere else and for longtime, I’ve discarded the possibility of coding problem.
By the way, the error only occur when the code executes the query on the line: sqlDa.Fill(dt);
************************* UPDATED **********************
My web.config file which sets the culture of the application is the same as on the other servers as well. This server is located in another country so the culture is the problem.
Is there anywhere else I need to change the culture for the server? or/and how can I see the culture of my sql data base?
Well guys, for everyone that helped me thx a lot..
I solved my problem, and I doubt someone will have the same problem as mine, but anyway, here is what i did to fix it:
You’ll Need to have full access to the server, else you would have to use the CONVERT() function on every query, and that would be too much work.
So what I did was to change the default langue of my user on the sql server, and that solved my problem 100%
Ps: Never store a DateTime value on another data type. With that in mind, you will not have the same problem as mine!