Answer the question
In order to leave comments, you need to log in
How to update data in SQlite3 using C#?
Hello. I enter the given sqlite database in this way and everything works:
string connection = @"Data Source=c:\\sqlite\\taskdb.db;Version=3";
SQLiteConnection sqlite_conn = new SQLiteConnection(connection);
int i = Convert.ToInt32(isCompletedCheckBox.Checked);
string stringQuery = "insert into task(task, doDate, Details, Done) values('" + this.titleTextBox.Text + "','" + this.doDatePicker.Text + "' ,'" + this.detailsTextBox.Text + "','" + i + "' )";
sqlite_conn.Open();//Open the SqliteConnection
var SqliteCmd = new SQLiteCommand();//Initialize the SqliteCommand
SqliteCmd = sqlite_conn.CreateCommand();//Create the SqliteCommand
SqliteCmd.CommandText = stringQuery;//Assigning the query to CommandText
SqliteCmd.ExecuteNonQuery();//Execute the SqliteCommand
sqlite_conn.Close();//Close the SqliteConnection
this.Close();
...................
string stringQuery = "Update task SET (task, doDate, Details, Done) values('" + this.titleTextBox.Text + "','" + this.doDatePicker.Text + "' ,'" + this.detailsTextBox.Text + "','" + i + "' )";
sqlite_conn.Open();//Open the SqliteConnection
..............
Answer the question
In order to leave comments, you need to log in
UPDATE is spelled differently:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question