OracleDataTable Index out of range

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Stada
Posts: 5
Joined: Thu 24 May 2007 09:25

OracleDataTable Index out of range

Post by Stada » Mon 04 Jun 2007 07:58

I have a simple select query with a result of one row, it works fine with the
myDataTable = New OracleDataTable
myDataTable.SelectCommand = New OracleCommand("select ...", myConnCL)
myDataTable.Active = True
DataGrid.DataSource = myDataTable

but this give the Error "There is no row at position 0.":
myData = myDataTable.Rows(0)("IDTOUR")

In the DataGrid ist the line with my correct Data!

I use the latest OraDirect 4.00.14.1 Mobile.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 04 Jun 2007 09:22

Please send me a small test project to reproduce the problem. It is
desirable to use 'scott' schema objects, otherwise include definition of your own database objects.
Use e-mail address provided in the Readme file.
Do not use third party components.

Stada
Posts: 5
Joined: Thu 24 May 2007 09:25

Post by Stada » Mon 04 Jun 2007 12:47

I have located the problem. I have to set myTable to the DataGrid.DataSource before I get the rows like:

DataGrid.DataSource = myDataTable
MainForm.pID_TOUR = myDataTable.Rows(0)("IDTOUR")

Works fine - THX

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 05 Jun 2007 06:54

Not at all.

Post Reply