OracleDataTable - Asynchronously - BeginFill EndFill Usage
OracleDataTable - Asynchronously - BeginFill EndFill Usage
Hi, could you please supply me with a Sample working code where can i see the right usage of fetching data asynchronously from database using OracleDataTable?, i have studied all information related that is available (OracleDataTable Advanced Features) and so on, but i couldn't get to work it, i would you use BeginFill,EndFill, CancelFetch etc. when i want.
I wrote the code below, but there is no records fectched when i got the result :
myResult = (AsynResult)this.oracleDataTable.BeginFill(new AsynCallBack(OperationComplete),this.oracleDatable);
thanks
I wrote the code below, but there is no records fectched when i got the result :
myResult = (AsynResult)this.oracleDataTable.BeginFill(new AsynCallBack(OperationComplete),this.oracleDatable);
thanks
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
Also i noticed that :
oracleDataTable.Rows.Count = 0
oracleDataTable.Columns.Count = 12;
meaning that Columns definitions were loaded but data don't.
oracleDataTable.Rows.Count = 0
oracleDataTable.Columns.Count = 12;
meaning that Columns definitions were loaded but data don't.
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
Hi, finnally i got to the code below :
myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM Dept";
IAsyncResult aRes = myDataTable.BeginFill(null, null);
Console.Write("Fetch in process");
Thread.Sleep(100);
myDataTable.SuspendFill(true);
Console.Write("Fetch is stopped");
myDataTable.EndFill(aRes);
Console.Write("All records are fetched");
I fetched the data and show it in DataGriview by setting the Datasource property, however the fetching proccess only retrieve 5 records automaticatly, how can increase the nummber of records fetched at once.
Thanks in advance for your help.
myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM Dept";
IAsyncResult aRes = myDataTable.BeginFill(null, null);
Console.Write("Fetch in process");
Thread.Sleep(100);
myDataTable.SuspendFill(true);
Console.Write("Fetch is stopped");
myDataTable.EndFill(aRes);
Console.Write("All records are fetched");
I fetched the data and show it in DataGriview by setting the Datasource property, however the fetching proccess only retrieve 5 records automaticatly, how can increase the nummber of records fetched at once.
Thanks in advance for your help.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
We are investigating the issue and will notify you about the results as soon as possible.
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
The number of records fetched at once during Asynchronous BeginFill execution can't be set. Asynchronous Fetch is not designed for this. If you want to control the number of records fetched at once, you should use Sequential Fetch Mode or Paginal Fetch Modelewis wrote:how can increase the nummber of records fetched at once.
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
After many tries ,finally i got to make the code you suggest works, I call the beginFill method many times and my grid is populate with next group o records as expected
IAsyncResult aRes = myDataTable.BeginFill(null, null);
Thead.Sleep(500);
but the problem i have right now is, how I get to know that there are no more records to fetch from database. As a example i have a table with 240 records. so :
-the first BeginFill fetchs 100 records.
-the second BeginFill fetths 200 records.
-I expected the next BeginFill will fecth 40 records but instead it fecths 100 more, it seems like Begin start again the fecth from the beginning, i could to know if all completed records are fetching i can disable the subsequents BeginFills.
-On the other side somethings the queried table has no much records, so only one BeginFill is enough so i need to avoid user call the next beginFill (Button disable), but have no something in order compare values: RecordCount.
QueryRecordCount is very expensive to use in Large Data Tables.
synchronous FillPage tells me at least how many records fetched.
Thanks in advance for your help
IAsyncResult aRes = myDataTable.BeginFill(null, null);
Thead.Sleep(500);
but the problem i have right now is, how I get to know that there are no more records to fetch from database. As a example i have a table with 240 records. so :
-the first BeginFill fetchs 100 records.
-the second BeginFill fetths 200 records.
-I expected the next BeginFill will fecth 40 records but instead it fecths 100 more, it seems like Begin start again the fecth from the beginning, i could to know if all completed records are fetching i can disable the subsequents BeginFills.
-On the other side somethings the queried table has no much records, so only one BeginFill is enough so i need to avoid user call the next beginFill (Button disable), but have no something in order compare values: RecordCount.
QueryRecordCount is very expensive to use in Large Data Tables.
synchronous FillPage tells me at least how many records fetched.
Thanks in advance for your help
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
Please create and send us a complete small test project with corresponding DDL/DML scripts that reproduce the issue and describe the steps we should follow in order to reproduce the issue.
Please also describe the behavior you expect on each step, and the behavior you get.
Please also describe the behavior you expect on each step, and the behavior you get.
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
Ok , please give time in order to prepare the demo. thanks for your answer.
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
hi,I've just sent the Demo application, i'm sorry for the delay
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
We did not receive a demo project. Please send it to the following email support at devart dot com or via contact form. If your project has a size of several megabytes or more, you can archive your project and upload it to our ftp server (ftp://ftp.devart.com, credentials: anonymous/anonymous ) or to any file exchange server so that we could download it from there. You can send us the password to the archive via our contact form.
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
this is the link for the demo project :https://1drv.ms/u/s!Ap7GLUK36zn2kXVN_oKTfzrmpVM8
thanks advance, please tell us when you got the file, thanks in advance
thanks advance, please tell us when you got the file, thanks in advance
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
Thank you for the test project. We are processing your request.
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
lewis, if I ran your code against a table with 240 records, it fetched all 240 records at once when pressing the BeginFil button.
You are using Asynchronous BeginFill in your project.
Please review Pinturiccio's answer:
"The number of records fetched at once during Asynchronous BeginFill execution can't be set. Asynchronous Fetch is not designed for this. If you want to control the number of records fetched at once, you should use Sequential Fetch Mode or Paginal Fetch Mode."
Taking into account this information, please specify:
1) the problem you have encountered (the expected behavior and the actual one)
2) the exact steps we should follow with your project to reproduce the issue
You are using Asynchronous BeginFill in your project.
Please review Pinturiccio's answer:
"The number of records fetched at once during Asynchronous BeginFill execution can't be set. Asynchronous Fetch is not designed for this. If you want to control the number of records fetched at once, you should use Sequential Fetch Mode or Paginal Fetch Mode."
Taking into account this information, please specify:
1) the problem you have encountered (the expected behavior and the actual one)
2) the exact steps we should follow with your project to reproduce the issue
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
My problem is :
how I get to know that there are no more records to fetch from database. As a example i have a table with 240 records. so :
-the first BeginFill fetchs 100 records. -- is ok
-the second BeginFill fetths 200 records. --is ok
-I expected the next BeginFill will fecth 40 records but instead it fecths 100 more, it seems like Begin start again the fecth from the beginning, i could to know if all completed records are fetching i can disable the subsequents BeginFills.
-On the other side somethings the queried table has no much records, so only one BeginFill is enough so i need to avoid user call the next beginFill (Button disable), but have no something in order compare values: RecordCount.
QueryRecordCount is very expensive to use in Large Data Tables.
synchronous FillPage tells me at least how many records fetched.
There is something curios, If i use the grid scroll down, the grid fills gradually with the records and when if it got the end of records (240), grids stops and it is ok.
If i am Fillpage it works well because it knows how many records fechted but it its very slow.
Thanks in advance for your help
how I get to know that there are no more records to fetch from database. As a example i have a table with 240 records. so :
-the first BeginFill fetchs 100 records. -- is ok
-the second BeginFill fetths 200 records. --is ok
-I expected the next BeginFill will fecth 40 records but instead it fecths 100 more, it seems like Begin start again the fecth from the beginning, i could to know if all completed records are fetching i can disable the subsequents BeginFills.
-On the other side somethings the queried table has no much records, so only one BeginFill is enough so i need to avoid user call the next beginFill (Button disable), but have no something in order compare values: RecordCount.
QueryRecordCount is very expensive to use in Large Data Tables.
synchronous FillPage tells me at least how many records fetched.
There is something curios, If i use the grid scroll down, the grid fills gradually with the records and when if it got the end of records (240), grids stops and it is ok.
If i am Fillpage it works well because it knows how many records fechted but it its very slow.
Thanks in advance for your help
Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage
- I connect to the database
- I have the select select * from user_objects
--Now i press "Begin" button.
- I know select count( *) from user_objects returns 650 records
-192 records are fetched
-I press "Next Asyn" button for the next group of records
-589 records are fetched so far.
-I will expected the next "Next Asyn" press will return 650-589 records no more, so i press "Next Asyn"
-As you can se the final records fetched are not 650 are 734? why?
in the following link there is a word file with the screens https://1drv.ms/w/s!Ap7GLUK36zn2kXq4eGWMJ__Rn3VE showing the result
Thanks
- I have the select select * from user_objects
--Now i press "Begin" button.
- I know select count( *) from user_objects returns 650 records
-192 records are fetched
-I press "Next Asyn" button for the next group of records
-589 records are fetched so far.
-I will expected the next "Next Asyn" press will return 650-589 records no more, so i press "Next Asyn"
-As you can se the final records fetched are not 650 are 734? why?
in the following link there is a word file with the screens https://1drv.ms/w/s!Ap7GLUK36zn2kXq4eGWMJ__Rn3VE showing the result
Thanks