If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Some pervasive help. C#.Net

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-11-09, 06:45
callekamel callekamel is offline
Registered User
 
Join Date: Feb 2009
Posts: 4
Some pervasive help. C#.Net

Hi.

I'm new at using pervasive, and it does not run correctly for me.
and I down't seems to get the data as fast as I shut.
I down know how I can make it better, i have made a small test using the ADO.Net from the parvasive site.
I'm using the 3.0 version, ADO.net file.
I'm using psql 10.13.

I want to test how long time it take to loop through 10.000 call's to the database.

here is my code
Code:
//Start the timer
DateTime now = DateTime.Now;

// Create a pervasive connection.
PsqlConnection pConnection;
pConnection = new PsqlConnection("ServerName=xx.xx.xx.xx;dbq=xxxxxxxx;");

// Create a SQL statement
string sSQL = "select * from picture where pictureid = 57750";

// Create a pervasice command
PsqlCommand pCommand = new PsqlCommand(sSQL, pConnection);

// Open Connection
pCommand.Connection.Open();

// Loop the action
for (int i = 1; i < 10000; i++)
{
        // Create and get pervasive dataReader
        PsqlDataReader pDataReader;
        pDataReader = pCommand.ExecuteReader();

        // Get the result        
        while (pDataReader.Read())
        {
             // Get value
             Response.Write("PictureID: " + pDataReader["pictureid"].ToString());
             Response.Write("<br>");
        }
        // Close the DataReader
        pDataReader.Close();
}

// Close connection
pCommand.Connection.Close();

// Stop the timer, and write the result.
Response.Write("Result   : " + (DateTime.Now - now).ToString());
Time result of this test is: 00:01:04.7657910
And I think this is a warry long time for selecting from a database.
if I make the same code just to a Sql component instead of a psql component and a mssql database then my result is: 00:00:04.0720000

I think there is a big difference.

is there anyone who can tell me what I should do to optimize this?
Reply With Quote
  #2 (permalink)  
Old 05-11-09, 10:41
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,015
First, comparing PSQL to MSSQL is not a valid comparison. If you call Pervasive and try to compare performance with MSSQL, they will not make any guarantees on performance.
Second, 1 minute for 10,000 query executions is pretty good.
Third, if you really want to make sure you're optimized there's a few things to check.

Things to check:
- Cache allocation. This is in the Configuration section of the PCC. (http://docs.pervasive.com/products/d...igref.5.7.html)
- QUery Plan. Make sure that the query is actually using an index.

If you are really concerned about performance then you shouldn't be using SQL. You should use the Btrieve API interface.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 05-15-09, 05:25
Abrahm75 Abrahm75 is offline
Registered User
 
Join Date: Feb 2009
Location: Sweden
Posts: 19
Hi all,
am new for using Pervasive v10 and if i need to use 3.0 version ADO.net

so i need to know how i can do this in coding side, in C#.net and asp.net, i mean what shall i use in :

1- Using Directive;

using ??????????????????????;

2- i know that i need to use odbcconnection as a conn, but i need to know how, can i read and write to the Pervasive ???


P.S: i tried to get the connection on my Server Explorer but am getting error message that "Unable to find the requested.Net framework Data Provider. It may not be installed"


so grateful. thank you
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On