Hi,
I've created a dataset with a datatable with a parameter for the select command.
I fill the datatable with data based on parameter 1 => data is shown
I fill the datatable with data based on parameter 2 => no data is shown
My code was the following:
myDataTable.SelectCommand.Parameters["MyParam"].Value = myValue;
myDataTable.Clear();
myDataTable.Active = true;
After some research I found that the problem lies in the fact that for the second time the current row in the DataTable isn't set.
I had to add the following code:
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(myDataTable);
view.MoveCurrentToFirst();
Shouldn't this code be included in the setting of the Active property of the DataTable. In other words: Shouldn't this be a feature of DotConnect for Oracle?
Regards,
Matthieu de Graaf
Refresh of datatable with parameter in select command
-
- Posts: 18
- Joined: Wed 14 May 2008 12:13
We cannot reproduce the problem with dotConnect for Oracle 5.0.20. The script for the Dept table is here: http://www.devart.com/forums/viewtopic.php?t=13955 . My select command for the Dept table from dataSet11:C#:As a result, the row with deptno=20 appears in dataGridView1. Please tell us how we should modify this sample to reproduce the problem or give us your select command with the definitions of database objects you are using.
Code: Select all
select * from SCOTT.DEPT where deptno=:deptno1 or deptno=:deptno2
Code: Select all
dataSet11.DEPT.SelectCommand.Parameters["deptno2"].Value = 20; //deptno1 is null
dataSet11.DEPT.Clear();
dataSet11.DEPT.Active = true;
dataGridView1.DataSource = dataSet11;
dataGridView1.DataMember = "dept";
-
- Posts: 18
- Joined: Wed 14 May 2008 12:13
-
- Posts: 18
- Joined: Wed 14 May 2008 12:13
Sample send
Hi Shalex,
I managed to reproduce this issue in a simple application
I'll send you this sample shortly
Regards,
Matthieu
I managed to reproduce this issue in a simple application
I'll send you this sample shortly
Regards,
Matthieu