import data from Excel to MySql using VB
<pre><code>Imports System.Data.Odbc
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports MySql.Data
Imports MySql.Data.MySqlClient
Imports ADODB
.
.
.
Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
            Try
                Dim conn As New OdbcConnection
                Dim rset As New DataSet
                Dim buff0 As String
                Dim buff1 As String
                Dim buff2 As String
                Dim filePath As String = "C:\\Book3.xls"

                conn.ConnectionString = "Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};DriverId=790;Dbq=" &amp; filePath &amp; ";" 'Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=d:\temp\test.xls;"
                conn.Open()
                rset.Open("select * from [Sheet1$]", conn, CursorTypeEnum.adOpenForwardOnly)
                Do Until rset.EOF
                    buff0 = rset(0).Value
                    buff1 = rset(1).Value
                    buff2 = rset(2).Value

                    MySqlCmd = New MySqlCommand
                    MySqlCmd.Connection = Myconnect
                    MySqlCmd.CommandText = "INSERT INTO customers  VALUES('" &amp; buff0 &amp; "','" &amp; buff1 &amp; "','" &amp; buff2 &amp; "')"
                    MySqlCmd.ExecuteNonQuery()
                    rset.MoveNext()
                Loop
                MsgBox("Import Successful!", MsgBoxStyle.Information, Title:="SOMS")
            Catch ex As Exception
                MsgBox("Import Unsuccessful!", MsgBoxStyle.Critical, Title:="SOMS")
            End Try
        End Sub
</code></pre>

<p>I am trying to import data from excel to mysql using this code got from web. But getting some errors. Give me suggestion where i am going wrong. I am very newbe for ADO,OLE. here i am using ODBC for reading data from excel and for insert I use mysql native driver. Another question is, Am i going in right direction or otherways possible? </p>