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?