我正在使用数据库创建我的第一个应用程序,但出现错误:
SQLite error near "dasani2": syntax error
这是我的数据库结构和第一行:
id name lastname username password
1 first second dasani dasani2
这是我的程序代码:
SQLiteConnection sqliteCon = new SQLiteConnection(dbConnectionString);
try
{
sqliteCon.Open();
string Query = "select * from Users where username='" + Vartotojas.Text.Trim() + "'and password'" + Slaptazodis.Text.Trim() + "'";
SQLiteCommand createCommand = new SQLiteCommand(Query, sqliteCon);
createCommand.ExecuteNonQuery();
SQLiteDataReader dr = createCommand.ExecuteReader();
}