If (Radiobuttonlist1.SelectedItem.Value = 2) Then Dim path As String 'path = upload.PostedFile.FileName path = "D:\Karthi Scripts\XML CHK\shg_repayment.xls" 'Response.Write(path) 'Response.End() Dim connect As String connect = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source= '" + path + "'" + "Extended Properties='Excel 4.0;HDR=Yes;IMEX=1;'" Dim conn As New OleDbConnection(connect) conn.Open() Dim ds = New DataSet() Dim od As New OleDbCommand("SELECT * FROM [Sheet1$]", conn) Dim orr As OleDbDataReader grdView.DataSource = orr grdView.DataBind() conn.Close() End If
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: Format of the initialization string does not conform to the OLE DB specification. Source Error: Line 341: connect = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source= '" + path + "'" + "Extended Properties='Excel 4.0;HDR=Yes;IMEX=1;'" Line 342: Dim conn As New OleDbConnection(connect) Line 343: conn.Open() Line 344: Dim ds = New DataSet() Line 345: Dim od As New OleDbCommand("SELECT * FROM [Sheet1$]", conn)
connect = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source= '" + path + "'" + ";Extended Properties='Excel 4.0;HDR=Yes;IMEX=1;'"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)