jdy0803
Well-known member
I'm trying retriving EXCEL data like following
I refered this link(How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET)
---------------------------------------------
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.Open()
Dim cmd1 As New System.Data.OleDb.OleDbCommand("Select * From [EmployeeData$] WHERE id = 1", conn1)
Dim rdr As OleDbDataReader = cmd1.ExecuteReader
Do While rdr.Read()
Loop
rdr.Close()
conn1.Close()
---------------------------------------------
Without WHERE clause, it works well.
But, if I use WHERE condition(WHERE id = 1), can't retrieve data(can't go into Do While loop)
Does anybody have an idea to about this?
I refered this link(How To Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET)
---------------------------------------------
Dim conn1 As New System.Data.OleDb.OleDbConnection(m_sConn1)
conn1.Open()
Dim cmd1 As New System.Data.OleDb.OleDbCommand("Select * From [EmployeeData$] WHERE id = 1", conn1)
Dim rdr As OleDbDataReader = cmd1.ExecuteReader
Do While rdr.Read()
Loop
rdr.Close()
conn1.Close()
---------------------------------------------
Without WHERE clause, it works well.
But, if I use WHERE condition(WHERE id = 1), can't retrieve data(can't go into Do While loop)
Does anybody have an idea to about this?