Hello!
I'm having trouble with my UPDATE Query, I'm using an SQLite DB, it has a table called Brand_Table, this table has only 2 columns: [ID] and [Name]. I can INSERT and DELETE records from it, but updating is giving me a headache.
When I run my UPDATE Query it hangs for about 31 seconds then it throws this error:
![Name: 01c.png
Views: 29
Size: 17.1 KB]()
I've been googling and checking lots of possible causes, but I found nothing to help in my particular scenario.
this my SQLite DB:
![Name: 01a.png
Views: 35
Size: 6.0 KB]()
![Name: 01.png
Views: 30
Size: 9.3 KB]()
This is my form:
![Name: 01b.jpg
Views: 31
Size: 15.0 KB]()
And this my code:
I'll appreciate any help!
Thank you.
I'm having trouble with my UPDATE Query, I'm using an SQLite DB, it has a table called Brand_Table, this table has only 2 columns: [ID] and [Name]. I can INSERT and DELETE records from it, but updating is giving me a headache.
When I run my UPDATE Query it hangs for about 31 seconds then it throws this error:
I've been googling and checking lots of possible causes, but I found nothing to help in my particular scenario.
this my SQLite DB:
This is my form:
And this my code:
VB.NET Code:
Using connection_1 As New SQLiteConnection("Data Source=C:\WinMiniSuper\DB2\MiniSuper.db;Version=3;") If (connection_1.State = ConnectionState.Closed) Then connection_1.Open() Dim ID_Scalar As Integer = 0 Using Command1 As New SQLiteCommand("SELECT ID_ FROM Brand_Table WHERE Name = '" & ComboBox1.Text & "'", connection_1) ID_Scalar = Convert.ToInt32(Command1.ExecuteScalar()) End Using Using Command2 As New SQLiteCommand("UPDATE Brand_Table SET Name = @TB1 WHERE ID_ = '" & ID_Scalar & "'", connection_1) Command2.Parameters.AddWithValue("@TB1", TextBox1.Text) Command2.ExecuteNonQuery() End Using End Using
I'll appreciate any help!
Thank you.