Rekan milis saya mempunyai error "Missing the DataColumn 'KEY' in the DataTable 
'Table' for the SourceColumn 'KEY'."Tolong pencerahannya...soalnya ketika saya 
menampilkan data kedalam grid, semua berjalan baik, tetapi waktu gridview saya 
hapus, error ini mulai muncul....
   
 strSQL = "select * from [" & ExcelSheetName & "]"

        Dim daSource As New OleDbDataAdapter(strSQL, XLSconnection)
        Dim dsSource As New DataSet
        daSource.Fill(dsSource)
        Dim dtSource As New DataTable
        dtSource = dsSource.Tables(0)
        ProgressBar1.PerformStep()
        'DataGridView1.DataSource = dtSource
       
 ProgressBar1.PerformStep()
       
 XLSconnection.Close()


        ProgressBar1.Maximum = dsSource.Tables(0).Rows.Count
        Dim importDA As New SqlDataAdapter("SELECT * FROM " & tblname, 
oconnection)
        Dim importDB As New SqlCommandBuilder(importDA)
        importDA.InsertCommand = importDB.GetInsertCommand
        Dim r As DataRow

        For Each r In dsSource.Tables(0).Rows
            r.SetAdded()
            ProgressBar1.PerformStep()
            
        Next
        Label5.Text = "Proses
 import data...."

        importDA.Update(dsSource)  ----> Darisini errornya Missing the 
DataColumn 'KEY' in the DataTable 'Table' for the SourceColumn 'KEY'.
        dtSource = dsSource.Tables(0)
        'DataGridView2.DataSource = dtSource
        ProgressBar1.PerformStep()
        oconnection.Close()

Terimakasih sebelumnya....


      


      

Kirim email ke