I am trying to load a datagrid from an Excel spreadsheet with data coming from multiple columns (but not necessary next to eachother)
However - this gives me all combinations from the two columns, whilest I just want G1 and K1, G2 and K2, G3 and K3 etcCode:strsql = "SELECT distinct * FROM [ImportUOM$g:g], [ImportUOM$k:k]" Dim Conn1 As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & path & ";" & _ "Extended Properties=""Excel 8.0;IMEX=1;HDR=Yes""" Dim conn2 As New System.Data.OleDb.OleDbConnection(Conn1) Dim da As New OleDbDataAdapter(strsql, conn2) Dim objds As New DataSet da.Fill(objds, "UOMConv")
How can I get this to work?




Reply With Quote