1. January 8, 2021
- Bug: Failed to load the file or assembly "DAL" or one of its dependencies. The system can not find the file specified.
- Reason: When writing reflection, configuration file and abstract factory, the DAL layer does not refer to the Factory layer
2. January 9, 2021
- Bug: Failed when converting string to smalldatetime data type.
- Reason: The SQL statement for inserting the data is wrong. The parameters @uid and @ontime should not be enclosed in single quotes. The effect of adding @ is that the following content is treated as a string, which is the same as the single quote.
string sql = @"Insert into Line_Info (UserID,OnTime) values('@uid','@ontime')//错误
string sql = @"Insert into Line_Info (UserID,OnTime) values(@uid,@ontime)//正确
3.January 11, 2021
- Bug: SqlDateTime overflowed. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.
- Reason: An error occurred when passing a value to the SQL statement, which caused a null value to be passed. The default is null.
4. February 6, 2021
- Bug: The variable name'@checkstate' has been declared. The variable name must be unique within the query batch or stored procedure.
- Reason: command.Parameters, the parameters passed in here are case-insensitive, so'@CheckState' and'@checkstate' are considered to be the same parameter, and repeated passing of values results in not uniqueness in the stored procedure.
string sql = @"update Recharge_Info set AccountDate=@AccountDate , CheckState=@CheckState where OperatorUserID=@id and CheckState=@checkstate";
5.February 7, 2021
- Bug: An error occurred while creating the window handle.
- Reason: Change to Environment.Exit(1); no error is reported, the reason is unknown.
//错误出在这句话上,它的作用是完全退出程序,因为Application.Exit();会导致一些线程退不干净
Environment.Exit(0);