excel file into dataset
-
Can someone please help? I know there should be a way to do this but i just can't find it or figure it out. Any help would be greatly appreciated, thanks.... I am getting the following error message: System.Data.OleDb.OleDbException: Invalid internet address. Line 53: Line 54: Line 55: MyConnection.Open() Line 56: ' Select the data from Sheet1 of the workbook. Line 57: MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ strpath = "http://www.myserver.com/viewexcel.csv" Dim DS As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As System.Data.OleDb.OleDbConnection Dim myconstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & strPath & "';Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" MyConnection = New System.Data.OleDb.OleDbConnection(myconstr) MyConnection.Open() ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ "select * from [ViewExcel$]", MyConnection) DS = New System.Data.DataSet MyCommand.Fill(DS) MyConnection.Close() dgTest.DataSource = DS dgTest.DataBind() Da Intern
-
Can someone please help? I know there should be a way to do this but i just can't find it or figure it out. Any help would be greatly appreciated, thanks.... I am getting the following error message: System.Data.OleDb.OleDbException: Invalid internet address. Line 53: Line 54: Line 55: MyConnection.Open() Line 56: ' Select the data from Sheet1 of the workbook. Line 57: MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ strpath = "http://www.myserver.com/viewexcel.csv" Dim DS As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As System.Data.OleDb.OleDbConnection Dim myconstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & strPath & "';Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" MyConnection = New System.Data.OleDb.OleDbConnection(myconstr) MyConnection.Open() ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ "select * from [ViewExcel$]", MyConnection) DS = New System.Data.DataSet MyCommand.Fill(DS) MyConnection.Close() dgTest.DataSource = DS dgTest.DataBind() Da Intern
Do you need the embedded quotes around the Data Source parameter in the connection string?
-
Can someone please help? I know there should be a way to do this but i just can't find it or figure it out. Any help would be greatly appreciated, thanks.... I am getting the following error message: System.Data.OleDb.OleDbException: Invalid internet address. Line 53: Line 54: Line 55: MyConnection.Open() Line 56: ' Select the data from Sheet1 of the workbook. Line 57: MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ strpath = "http://www.myserver.com/viewexcel.csv" Dim DS As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter Dim MyConnection As System.Data.OleDb.OleDbConnection Dim myconstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='" & strPath & "';Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1""" MyConnection = New System.Data.OleDb.OleDbConnection(myconstr) MyConnection.Open() ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter( _ "select * from [ViewExcel$]", MyConnection) DS = New System.Data.DataSet MyCommand.Fill(DS) MyConnection.Close() dgTest.DataSource = DS dgTest.DataBind() Da Intern
-
Do you need the embedded quotes around the Data Source parameter in the connection string?
Still getting same error message. Da Intern