Query.Fields[0]
Posted: Tue 23 Nov 2004 14:56
I'm having a similar problem, but when I try to read Query.Fields[0], I get the following error message:
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll
Additional information: Index was outside the bounds of the array.
Here's a sample of my code:
Dim MyCommand As New OleDb.OleDbCommand
MyCommand.Connection = MyConnection
MyCommand.CommandText = "select count(*) from employee"
Dim MyDataReader As OleDb.OleDbDataReader
MyDataReader = MyCommand.ExecuteReader
MyDataReader.Read()
If Me.C1tbID.Tag = MyDataReader.GetValue(0) Then
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.data.dll
Additional information: Index was outside the bounds of the array.
Here's a sample of my code:
Dim MyCommand As New OleDb.OleDbCommand
MyCommand.Connection = MyConnection
MyCommand.CommandText = "select count(*) from employee"
Dim MyDataReader As OleDb.OleDbDataReader
MyDataReader = MyCommand.ExecuteReader
MyDataReader.Read()
If Me.C1tbID.Tag = MyDataReader.GetValue(0) Then