Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Speeding up query
Message
From
07/11/2002 12:03:25
 
 
To
07/11/2002 11:53:19
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00719885
Message ID:
00719891
Views:
16
Jerry,

At first glance, what you've done looks right ... I don't know how you can speed it up.

~~Bonnie



>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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform