Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Slow SQL in .NET on Fox Tables
Message
From
23/05/2004 16:15:58
 
 
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00906289
Message ID:
00906330
Views:
11
Hi Kevin,

Here is my SQL select statement and reader code:

_____________________________________________________________________________
Dim sb As New StringBuilder
sb.Append("SELECT job_num, product, slot FROM prodwip WHERE job_num = " + " '" + txtJobNum.Text + "'")
sb.Append(" AND (product = '877'")
sb.Append(" OR product = '863'")
sb.Append(" OR product = 'NP2')")

strSelectProdwip = sb.ToString

Dim oFoxSelectCommand As New OleDbCommand(strSelectProdwip, OleDbConnection)


OleDbConnection.Open()

Dim oReaderProdWip As OleDbDataReader
oReaderProdWip = oFoxSelectCommand.ExecuteReader

' -----------Fill in dropdown list with new data

While oReaderProdWip.Read()
JobNum = (oReaderProdWip("job_num"))
Product = (oReaderProdWip("product"))
Slot = (oReaderProdWip("slot"))
ddProdwip.Items.Add(New ListItem(JobNum.Trim + " | " + Product.Trim + " | " + Slot.Trim))
ddProdwip.DataBind()
End While
_____________________________________________________________________________

This is the Index Expression from Foxpro:

TRIM(DTOS(canceled))+job_num

This queries a table that can have about 200,000 records in it.

To get my result set, which is ususally 1 to 4 records, I execute a reader then bind the results to a drop down list.

When I do a query for the same data in Foxpro, I use a SEEK and Scan...Endscan function which returns results back in a fraction of the time than whith the .Net code from my web page.

Help.....

Thank you!

Tim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform