2011-11-17 7 views
0
Dim lvitem As Object 
    Dim iCount As Integer 
    Dim iLoop As Integer 
    Dim query3 = New SqlCommand 
    query3.Connection = New SqlConnection("SERVER=localhost;UID=root;DATABASE=test;") 
    iCount = lvLogs.Items.Count() 
    If Not lvLogs.Items.Count = 0 Then 
     Do Until iLoop = lvLogs.Items.Count 
      lvitem = lvLogs.Items.Item(iLoop) 
      With LvItem 
       query3.CommandText = "insert into wer(CustomerName,SalesGroup,CustomerType,TypeOfIndustry,RM,SeniorRM) values('" & .SubItems(0).Text & "','" & .SubItems(1).Text & "','" & .SubItems(2).Text & "','" & .SubItems(3).Text & "','" & .SubItems(4).Text & "','" & .SubItems(5).Text & "')" 
       query3.ExecuteNonQuery() 
      End With 
      iLoop = iLoop + 1 
      LvItem = Nothing 
     Loop 
    End If 
    MessageBox.Show("Record Saved!") 

이것이 내 코드입니다. 메시지 상자가 나타나지만 레코드가 내 데이터베이스에 저장되지 않습니다. 도와주세요mysql 쿼리 브라우저 데이터베이스에 listview 데이터 저장

답변

1

SqlClient 공급자를 사용할 수 없습니다. MySql .net 커넥터 API를 사용해야하고 MySql connector examples을 살펴 봐야합니다.

+0

내가 무엇을 할 것인가? : –

+0

@SigridAnnOmila - 게시물을 보아주세요 (편집했습니다) – adatapost

+0

어디에서 찾을 수 있습니까? 무엇을 클릭해야합니까? –

관련 문제