By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,773 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

Multiple Queries

P: n/a
I have a VB7 aspx file I am creating that requires multiple queries each
dependant on the previous queries results. If I run these queries in foxpro,
I just run a query then create a cursor with the results of that cursor, then
run another query based on that cursor etc. My question is, how do I do this
in a VB7 aspx file? Below I have the code for the first query but I am not
sure where to go from here to run the rest of the queries that are after this
one.

dim FirstQuerySQL as String = "SELECT somast01.sono, somast01.custno,
somast01.u_cono, somast01.uname, somast01.utitle, somast01.uphone,
somast01.sodate, (somast01.shpamt + somast01.ordamt) AS Total_Sales,
somast01.u_id " & _
"FROM somast01 WHERE BETWEEN(sodate,{^2004/08/02},{^2004/09/02}) " & _
"AND somast01.u_id <> ' ' " & _
"UNION " & _
"SELECT soymst01.sono, soymst01.custno, soymst01.u_cono, soymst01.uname,
soymst01.utitle, somast01.uphone, soymst01.sodate, (soymst01.shpamt +
soymst01.ordamt) AS Total_Sales, soymst01.u_id " & _
"FROM soymst01 " & _
"WHERE soymst01.sono <> somast01.sono AND
BETWEEN(sodate,{^2004/08/02},{^2004/09/02}) " & _
"AND soymst01.u_id <> ' ' "

debug.writeline(FirstQuerySQL)
dim oDataConn as DataConn = new DataConn()
oDataConn.Open()
Dim objDataReader As OleDbDataReader =
oDataConn.GetDataReader(FirstQuerySQL)

Dim Dtable As Datatable = oDataConn.BuildDataTable(FirstQuerySQL)

LookupGrid.DataSource= Dtable
LookupGrid.DataBind()
oDataConn.close()
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
you can convert your queries into a nested query(nested select statement)
also you can use "into" statement ,i use it in pl/sql .
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.