I'm using entity framework
to process the sqlite
database. If there's no database and I want to insert one record, it will create the database successfully (I found the database file in disk) but throw the error:
The argument 'sql' cannot be null, empty or contain only white space.".
Then next time running, because the database has been created, all code works well with no error.
DbContext.Database.ExecuteSqlCommand(sqlCmd, parameters.ToArray());
Only throw above error when Database
not exist. If exist, work well.
This error may occur in case the "sqlCmd" variable is null or empty when the ExecuteSqlCommand method is called. Please make sure that this variable is correctly initialized in case the database does not exist.