How to fix the error, I can't see it?

Hello, I am working on desktop application and I have sleduyushaya error: when you enter data when you register there login and the password, and there is a record in the database, but when I try to log in to your account, I found that the database was not written with the entered login and password, and the names of the fields in which they are made, how to fix this error?
if (UserPassCheckField.Text == UserPassField.Text)
{
 SQLiteCommand cmd = new SQLiteCommand("INSERT INTO accounts (Login, Password) VALUES ('UserLoginField.Text', 'UserPassField.Text')", sqlCon);
cmd.ExecuteNonQuery();
 }

5e0cb60c1241e011263126.png
April 4th 20 at 00:30
1 answer
April 4th 20 at 00:32
Solution
if (UserPassCheckField.Text == UserPassField.Text)
{
 SQLiteCommand cmd = new SQLiteCommand("INSERT INTO accounts (Login, Password) VALUES ('"+UserLoginField.Text+"', '"+UserPassField.Text+"')", sqlCon);
cmd.ExecuteNonQuery();
 }
Bad teach. You need to use prepared statements. - maximilian.McLaughlin commented on April 4th 20 at 00:35
@maximilian.McLaughlin, you should start with simple question what... - Alexzander_Reing commented on April 4th 20 at 00:38

Find more questions by tags C#