P
Pooja
hi,
i am using microsoft jet engine to process an excel file and then uploading
it to the server
but i am getting the following error whent the application tries to open the
connection:
"
"External table is not in the expected format"
the code for this is mentioned below:
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
postedfile + ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
Dim conn As OleDbConnection
conn = New OleDbConnection(strConn)
conn.Open() '--------------------------here i am getting exception
dtSchema = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
If dtSchema.Rows.Count > 0 Then
strSQl = String.Format("SELECT * FROM [{0}$]",
dtSchema.Rows(0)("TABLE_NAME").ToString.Replace("'", "").Replace("$", ""))
End If
Please help
i am using microsoft jet engine to process an excel file and then uploading
it to the server
but i am getting the following error whent the application tries to open the
connection:
"
"External table is not in the expected format"
the code for this is mentioned below:
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
postedfile + ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
Dim conn As OleDbConnection
conn = New OleDbConnection(strConn)
conn.Open() '--------------------------here i am getting exception
dtSchema = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
If dtSchema.Rows.Count > 0 Then
strSQl = String.Format("SELECT * FROM [{0}$]",
dtSchema.Rows(0)("TABLE_NAME").ToString.Replace("'", "").Replace("$", ""))
End If
Please help