A
Abhi Kumar
Hi All,
I am reading an excel sheet using OLEDB connection , now what I want t
know is how can I make out that the sheet whether the sheet is blank o
not ??
Here is my code
////////////////////////////////////////////////////////////////////////////////////
Dim connString As [String] = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=" + excelFile + ";Extended Properties=Excel 8.0;"
objConn = New OleDb.OleDbConnection(connString)
Dim commandTxt As String = "Select * from [Sheet1$]"
command = New System.Data.OleDb.OleDbDataAdapter(commandTxt, objConn)
objConn.Open()
DS = New DataSet
command.Fill(DS)
////////////////////////////////////////////////////////////////////////////////
I tried this
Dim i as integer
i = DS.Tables(0).Rows.Count
if i > 1 then
end if
But the results were not as excepted and did not form any pattern
using which I could conclude that this condition gives me the exac
result
Thanx & Regards,
Abh
I am reading an excel sheet using OLEDB connection , now what I want t
know is how can I make out that the sheet whether the sheet is blank o
not ??
Here is my code
////////////////////////////////////////////////////////////////////////////////////
Dim connString As [String] = "Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=" + excelFile + ";Extended Properties=Excel 8.0;"
objConn = New OleDb.OleDbConnection(connString)
Dim commandTxt As String = "Select * from [Sheet1$]"
command = New System.Data.OleDb.OleDbDataAdapter(commandTxt, objConn)
objConn.Open()
DS = New DataSet
command.Fill(DS)
////////////////////////////////////////////////////////////////////////////////
I tried this
Dim i as integer
i = DS.Tables(0).Rows.Count
if i > 1 then
end if
But the results were not as excepted and did not form any pattern
using which I could conclude that this condition gives me the exac
result
Thanx & Regards,
Abh