General information
Category:
Visual FoxPro and .NET
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only