Error Description:
A project, the source is the boss gave, deployed to the Internet, run no problem, but in the local run, there will be problems, the problem is to some tables inserted records, the local no matter how to insert, and the Internet can be inserted, are the same code
Solve:
Spent a night debugging, and finally figuring it out, such as:
The SQL statement executed by the local program is the same as above, the time format is wrong, so the insert fails, the entire transaction is rolled back, so there is no record in the table.
Because my system is WIN10, the date format default has the day of the week, in the source he used is DateTime.Now.ToString (), so the format will have a problem, changed to DateTime.Now.ToString ("Yyyy-mm-dd HH : Mm:ss ")
Conclusion:
Look at other people's source is really annoying ah. No comments yet ... In the future, I want to find the source code, I also have to delete the source code in the comments are only OK.
. NET execution of SQL insert time issues