Hello to all!
I appreciate the invitation to the club vbforums! :wave:
I'm starting with visual studio 2010, and I have a doubt that I could possibly help ..
I have my listview and I want to save the data to a mysql table.
My code is:
but the problem is in the:
I read in the forums is possibly because it exceeds the capacity of characters.
But my table is VARCHAR (255) in all fields,
Does anyone who could help me?
Thank you!:thumb:
Best Regards!!
I appreciate the invitation to the club vbforums! :wave:
I'm starting with visual studio 2010, and I have a doubt that I could possibly help ..
I have my listview and I want to save the data to a mysql table.
My code is:
Code:
Dim strSQL As String
Dim lvItem As ListViewItem
Dim connstring As String = "Data Source=192.168.1.5;Database=clc;User ID=MXOGUZ;Password=***;"
Dim conn As New MySqlConnection(connstring)
Dim cmd As New MySqlCommand
conn.Open()
For Each lvItem In ListView1.Items
strSQL = "INSERT INTO resultado SET " & _
"ID_EMPLEADO='" & lvItem.SubItems(0).Text & "'," & _
"APELLIDO_1='" & lvItem.SubItems(1).Text & "'," & _
"APELLIDO_2='" & lvItem.SubItems(2).Text & "'"
cmd.CommandText = strSQL
cmd.ExecuteNonQuery()
Next
conn.Close()
End Sub
Code:
cmd.ExecuteNonQuery()
But my table is VARCHAR (255) in all fields,
Does anyone who could help me?
Thank you!:thumb:
Best Regards!!