Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Loop through Query in vb.net/asp.net

Author  Topic 

saidev
Posting Yak Master

101 Posts

Posted - 2006-07-21 : 22:49:09
Hi Guys,

I have a query that i need to go through the loop. can you guys help me how to put loop for this in vb.net.


If Me.rdounwired.Checked = True And Me.rdoallinv.Checked = True Then
sql = "SELECT DISTINCT fkGroup, fkAgency, fkAdvertiser FROM tblSpot WHERE fkInvoice IS NULL AND dateScheduled <= '" & Me.ddbmonth.SelectedValue & "' AND fkContractType = 'UNWIRED'"
Else
If Me.txtsubgroup.Text = "" Then
sql = "SELECT DISTINCT fkGroup, fkAgency, fkAdvertiser FROM tblContract WHERE fkGroup = '" & Me.txtgroup.Text & "' AND fkContractType = 'UNWIRED'"
Else
sql = "SELECT DISTINCT fkGroup, fkSubGroup, fkAgency, fkAdvertiser FROM tblContract WHERE fkGroup = '" & Me.txtgroup.Text & "' AND fkSubGroup = '" & Me.txtsubgroup.Text & "' AND fkContractType = 'UNWIRED'"
End If
End If
dbfunctions.RunSQLQuery(CONNECTIONSTRING, sql)

Thanks
   

- Advertisement -