OracleDataTable - Asynchronously - BeginFill EndFill Usage

OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Thu 02 May 2013 17:48

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
lewis
 
Posts: 13
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Thu 02 May 2013 18:56

Also i noticed that :

oracleDataTable.Rows.Count = 0
oracleDataTable.Columns.Count = 12;

meaning that Columns definitions were loaded but data don't.
lewis
 
Posts: 13
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Fri 03 May 2013 12:53

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.
lewis
 
Posts: 13
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Fri 10 May 2013 12:50

We are investigating the issue and will notify you about the results as soon as possible.
Pinturiccio
Devart Team
 
Posts: 1936
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Wed 15 May 2013 14:46

lewis wrote:how can increase the nummber of records fetched at once.

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
Pinturiccio
Devart Team
 
Posts: 1936
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Mon 17 Jul 2017 21:04

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
lewis
 
Posts: 13
Joined: Thu 13 Sep 2012 15:59

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby Pinturiccio » Mon 24 Jul 2017 11:25

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.
Pinturiccio
Devart Team
 
Posts: 1936
Joined: Wed 02 Nov 2011 09:44

Re: OracleDataTable - Asynchronously - BeginFill EndFill Usage

Postby lewis » Mon 24 Jul 2017 12:49

Ok , please give time in order to prepare the demo. thanks for your answer.
lewis
 
Posts: 13
Joined: Thu 13 Sep 2012 15:59


Return to dotConnect for Oracle