OracleDataTable Index out of range

OracleDataTable Index out of range

Postby 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.
Stada
 
Posts: 5
Joined: Thu 24 May 2007 09:25

Postby 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.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby 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
Stada
 
Posts: 5
Joined: Thu 24 May 2007 09:25

Postby Alexey » Tue 05 Jun 2007 06:54

Not at all.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for Oracle