Hi all could someone just point out whats my problem?
attached is the screenshot and the code
Imports MySql.Data.MySqlClient
Public Class Form1
Dim mysqlconn As MySqlConnection
Dim command As MySqlCommand
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
mysqlconn = New MySqlConnection
mysqlconn.ConnectionString =
"Data Source=DESKTOP-4CJK3CC\SQLEXPRESS;Initial Catalog=Inventory;Integrated Security=True"
Dim reader As MySqlDataReader
Try
mysqlconn.Open()
Dim query As String
query = "insert into dbo.item (ItemID,Item,asset,item_description,quantity,quantity_description, brand_name,product_name_code,serial,location,supplier,purchase_reff,sup_reff,value_in_PGk,open_stk,close_stk,vari,status,date,comments) values('" & TextBox1.Text & "' , '" & TextBox2.Text & "','" & TextBox3.Text & "','" & TextBox4.Text & "','" & TextBox5.Text & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" & TextBox8.Text & "','" & TextBox9.Text & "','" & TextBox10.Text & "','" & TextBox12.Text & "' ,'" & TextBox13.Text & "','" & TextBox14.Text & "','" & TextBox15.Text & "','" & TextBox16.Text & "','" & TextBox17.Text & "','" & TextBox18.Text & "','" & TextBox19.Text & "','" & TextBox20.Text & "','" & TextBox11.Text & "')"
command = New MySqlCommand(query, mysqlconn)
reader = command.ExecuteReader
MessageBox.Show("Data Saved")
mysqlconn.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Finally
mysqlconn.Dispose()
End Try
End Sub
End Class