Wrox Home  
Search P2P Archive for: Go

  Return to Index  

ado_dotnet thread: Filling a DataSet from a Pervasive.SQL Database


Message #1 by "Javier Escuriola" <jescurio@e...> on Fri, 12 Apr 2002 11:46:02
Hello 
I have a curious problem.

I'm developing a progrma that access to a Pervasive.SQl 200i database.

This database has its OLEDB drivers but they present problems in order to 
acces to a remote database. You can correct it mapping a network drive in 
your PC pointing to the remote folder where the database is.

OK, I've achieved access to the data form a table using a combination of 
ADO and ADO.Net objects, but access times are extremely bigs (more or less 
3 seconds to fill a DataGrid with 450 records from a unic table).

The code that I've wrote is:

	ADODB.Connection cn = new ADODB.Connection();
	ADODB.Recordset rs =new ADODB.Recordset(); 

	cn.Open("Provider=PervasiveOLEDB;Data 
Source=p:\\;Location=p:\\","","",0);
	rs.Open("tblPaciente", cn, ADODB.CursorTypeEnum.adOpenDynamic, 
ADODB.LockTypeEnum.adLockOptimistic, 512); 

	OleDbDataAdapter oDA= new OleDbDataAdapter();
	DataSet oDS=new DataSet();

	oDA.Fill(oDS,rs,"tblPaciente");
			
	cn.Close();
	dataGrid1.DataSource=oDS.Tables[0];

If I use the same code with a SQL-Server database (remote), I've got the 
data instantaneously.

I've alsso tried with a local pervasive database and the access time 
continues very high.

If anybody has any idea or has worked with Pervasive, please tell it to me.

Thank you everybody.

Javier
Message #2 by Richard Ainsley <rainsley@p...> on Fri, 12 Apr 2002 14:40:03 -0700
It's been a while since I access Pervasive databases, but it appears to me
that you have specified adOpenDynamic for the recordset. That means that you
want so set up all the mechanics needed to be kept aware of changes made by
other people in real time.  That is not only demanding of the computer's
time resoures but also requires a large overhead to perform..... Since you
want to use optimistic locking this request seems unreasonable.  Try a
forwardOnly recorset just to check the timing differences.....



----- Original Message -----
From: "Javier Escuriola" <jescurio@e...>
To: "ADO.NET" <ado_dotnet@p...>
Sent: Friday, April 12, 2002 4:46 AM
Subject: [ado_dotnet] Filling a DataSet from a Pervasive.SQL Database


> Hello
> I have a curious problem.
>
> I'm developing a progrma that access to a Pervasive.SQl 200i database.
>
> This database has its OLEDB drivers but they present problems in order to
> acces to a remote database. You can correct it mapping a network drive in
> your PC pointing to the remote folder where the database is.
>
> OK, I've achieved access to the data form a table using a combination of
> ADO and ADO.Net objects, but access times are extremely bigs (more or less
> 3 seconds to fill a DataGrid with 450 records from a unic table).
>
> The code that I've wrote is:
>
> ADODB.Connection cn = new ADODB.Connection();
> ADODB.Recordset rs =new ADODB.Recordset();
>
> cn.Open("Provider=PervasiveOLEDB;Data
> Source=p:\\;Location=p:\\","","",0);
> rs.Open("tblPaciente", cn, ADODB.CursorTypeEnum.adOpenDynamic,
> ADODB.LockTypeEnum.adLockOptimistic, 512);
>
> OleDbDataAdapter oDA= new OleDbDataAdapter();
> DataSet oDS=new DataSet();
>
> oDA.Fill(oDS,rs,"tblPaciente");
>
> cn.Close();
> dataGrid1.DataSource=oDS.Tables[0];
>
> If I use the same code with a SQL-Server database (remote), I've got the
> data instantaneously.
>
> I've alsso tried with a local pervasive database and the access time
> continues very high.
>
> If anybody has any idea or has worked with Pervasive, please tell it to
me.
>
> Thank you everybody.
>
> Javier


  Return to Index