Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009

    Unanswered: Some pervasive help. C#.Net


    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, 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
    //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
    // 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());
            // Close the DataReader
    // Close connection
    // 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?

  2. #2
    Join Date
    Dec 2001
    Provided Answers: 4
    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. (
    - 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
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Feb 2009
    Hi all,
    am new for using Pervasive v10 and if i need to use 3.0 version

    so i need to know how i can do this in coding side, in and, 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts