Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up query
Message
From
07/11/2002 11:53:19
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Speeding up query
Miscellaneous
Thread ID:
00719885
Message ID:
00719885
Views:
50
I have created a C# form to access a VFP table on our network. The following is the code I am using to query this table. Everything works but the speed isn't that good. It takes about 2 seconds to return the result. The same query in VFP is immediate.

The oConn.Open(); and the oDataAdapter.Fill(oDataSet,"MyTable"); seem to take the longest to execute. Is there anything I can do to speed up this query? Or a different way to do this?
string strAccessConn = "Provider=VFPOLEDB.1;Data " + 
"Source=P:\\Mydir\\;Mode=ReadWrite|Share Deny None;Extended " +
"Properties=\"\";User ID=\"\";Password=\"\";Mask Password=False;Cache " +
"Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN=\"\"";

string strAccessSelect = "SELECT * FROM MyTable WHERE MyField = '" + lcMyVar + "'";

DataSet oDataSet = new DataSet();
oDataSet.Tables.Add("MyTable");

OleDbConnection oConn = new OleDbConnection(strAccessConn);
OleDbCommand oAccessCommand = new OleDbCommand(strAccessSelect,oConn);
OleDbDataAdapter oDataAdapter = new OleDbDataAdapter(oAccessCommand);

oConn.Open();   //Slow here.
oDataAdapter.Fill(oDataSet,"MyTable"); //Slow here.
Thanks,

Jerry
Next
Reply
Map
View

Click here to load this message in the networking platform