hello
my first thread to as for something here
but i like daniweb a lot
i'm trying to save data from listview to sql server
Dim iCount As Integer
Dim iLoop As Integer
Dim query3 As New SqlCommand
Dim lvitem
query3.Connection = New SqlConnection("Password=sasa;Persist Security Info=True;User ID=sa;Initial Catalog=Tel;Data Source=HA-PC")
query3.Connection.Open()
' cn.ConnectionString = "Provider=SQLOLEDB.1;Password=sasa;Persist Security Info=True;User ID=sa;Initial Catalog=CRM0;Data Source=HA-PC"
iCount = lvLogs.Items.Count
' For iLoop = 0 To lvLogs.Items.Count - 1
If Not lvLogs.Items.Count = 0 Then
Do Until iLoop = lvLogs.Items.Count
lvitem = lvLogs.Items.Item(iLoop)
With lvitem
query3.CommandText = "insert into A(a,b,c,d,e,f,g) values " _
& "('" & .SubItems(0).Text & "','" & .SubItems(1).Text & "','" & .SubItems(2).Text & "','" & .SubItems(3).Text & "','" & .SubItems(4).Text & "','" & .SubItems(5) & "','" & .SubItems(6).Text & "')"
'" & .SubItems(6).Text & "','" & .SubItems(7).Text & "','" & .SubItems(8).Text & "')"
query3.ExecuteNonQuery()
End With
iLoop = iLoop + 1
lvitem = Nothing
Loop
End If
i dunno why a lot of errors
and i want more info about this listview what is mean of subitem and item and what is .subitem (0)
should i add something??
find attached pic for more info
thanks for help
:)