Hi guys I need your help on selecting data from 4 different worksheet. Here's my code
Dim MyConnection As New OleDbConnection("provider=Microsoft.ACE.OLEDB.12.0; Data Source='" & path & "'; Extended Properties=Excel 12.0;")
Dim cmd As OleDbCommand = New OleDbCommand("Select [MAM$].[Seller Name], [MAM$].[Final Computation], [MAM$].Designantion From [MAM$] Left Join [DSS$] on [MAM$].[Seller Name] = [DSS$].[Seller Name] Where [MAM$].Designation is not Null", MyConnection)
MyConnection.Open()
adpt = New OleDbDataAdapter(cmd)
'Here one CommandBuilder object is required.
'It will automatically generate DeleteCommand,UpdateCommand and InsertCommand for DataAdapter object
Dim builder As OleDbCommandBuilder = New OleDbCommandBuilder(adpt)
DtSet = New DataSet()
adpt.Fill(DtSet)
DataGridView1.DataSource = Nothing
DataGridView1.DataSource = DtSet.Tables(0).DefaultView
MyConnection.Close()
It says "No value given for one or more required parameters". I don't know if I can use Join in Excel.