Windows Form SQL Query Demo (asynchronously)

Windows Form SQL Query Demo (asynchronously)

Postby lewis » Thu 13 Sep 2012 16:40

Hi, I need to create a Windows Application that allows me:

-Show in a dataGrid from database by using a select statement.
-Load the grid asynchronously and stop the filling whenever i want.
-Navigate between records pages according a number of max records (asynchronously).
-Navigate through the final page of the records collection in the database and cancel it, if i want.

Could you please give me any help about those requierements above?

P.D. I have a small demo aplication already with the basica idea, could i send it? What is the e-mail?

I have read all documentation related but i have couldn't find the solution

Thanks in advance.
lewis
 
Posts: 15
Joined: Thu 13 Sep 2012 15:59

Re: Windows Form SQL Query Demo (asynchronously)

Postby Shalex » Tue 18 Sep 2012 15:51

Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Re: Windows Form SQL Query Demo (asynchronously)

Postby lewis » Thu 20 Sep 2012 17:17

Thanks for your answer,I read de information provided in the link already but i couldn't resolve my problem.

I sent the windows form demo application according with your suggestion.

Thanks.
lewis
 
Posts: 15
Joined: Thu 13 Sep 2012 15:59

Re: Windows Form SQL Query Demo (asynchronously)

Postby Pinturiccio » Fri 12 Oct 2012 12:48

lewis wrote:-Show in a dataGrid from database by using a select statement.

Set your DataTable as a value of the DataSource property for the dataGridView control.

lewis wrote:-Load the grid asynchronously and stop the filling whenever i want.

Use the BeginFill method for starting asynchronous fill. Use the SuspendFill method for suspending asynchronous fill operation. Use the EndFill method for ending an asynchronous invocation of the Fill method.
For more information, please refer to http://www.devart.com/dotconnect/oracle/docs/DataTable.html#pureasync

lewis wrote:-Navigate between records pages according a number of max records (asynchronously).

Use the FillPage or Open methods of the OracleDataTable class to navigate between records pages.
For more information, please refer to http://www.devart.com/dotconnect/oracle/docs/DataTable.html#paginal
http://www.devart.com/dotconnect/oracle/docs/?Devart.Data~Devart.Common.DbDataTable~FillPage.html
http://www.devart.com/dotconnect/oracle/docs/?Devart.Data~Devart.Common.DbDataTable~Open.html

lewis wrote:-Navigate through the final page of the records collection in the database and cancel it, if i
want.

You can get the number of records in your query by executing the following command:
Code: Select all
string str = "select count(*) from servsusc"; // by parsing this.txtSQL.Text, we get the select part, the part which would be an argument of the count function, and the last part which would begin with "from"
OracleCommand cmd = new OracleCommand(str, this.oracleConnection);
int count = Convert.ToInt32(cmd.ExecuteScalar());

After you know the count of records, you can call the FillPage method:
Code: Select all
this.oracleDataTable.FillPage(count-PageCount, PageCount);
Pinturiccio
Devart Team
 
Posts: 1978
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for Oracle