CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> .NET

 .NET while/loop thru a select query result

Print topic Send  topic

Author Message

Posts: 14
Posted: 12/14/2005, 10:04 PM

I have this problem that I need to do a while/loop thru a select query result. I’ve done this several times in CCS/ASP3.0, but I can’t seem to get it working on CCS/.NET(VB)

The code I use on ASP3.0 is this:
Dim SQL  
Dim RecordSet  
Dim D_EDQT01  
SQL = "select * from table_name"  
Set RecordSet = ConnectionName.Execute(SQL)  
do until RecordSet.EOF  
'Code Executed  
D_EDQT01 = RecordSet("EDQT01")  

In .NET (VB) I did this:

Dim D_EDQT01 As String  
Dim Request As HttpRequest = HttpContext.Current.Request  
Dim NewDao As DataAccessObject = Settings.MSDBDataAccessObject  
Dim Sql As String = Sql = “select * from table_name”  
Set Request = NewDao.RunSql(Sql)  
do until Request.EOF  
'Code Executed  
D_EDQT01 = Request("EDQT01")  

And I get these errors:
Quote :
Error: C:\DOCUME~1\GUILLE~1\LOCALS~1\Temp\~DROGU~1\basket.aspx.vb(360) : error BC30807: 'Let' and 'Set' assignment statements are no longer supported.

Set Request = NewDao.RunSql(Sql)
Error: C:\DOCUME~1\GUILLE~1\LOCALS~1\Temp\~DROGU~1\basket.aspx.vb(360) : error BC30311: Value of type 'System.Data.DataSet' cannot be converted to 'System.Web.HttpRequest'.

Set Request = NewDao.RunSql(Sql)
Error: C:\DOCUME~1\GUILLE~1\LOCALS~1\Temp\~DROGU~1\basket.aspx.vb(377) : error BC30456: 'EOF' is not a member of 'System.Web.HttpRequest'.

do until Request.EOF
Error: C:\DOCUME~1\GUILLE~1\LOCALS~1\Temp\~DROGU~1\basket.aspx.vb(401) : error BC30456: 'MoveNext' is not a member of 'System.Web.HttpRequest'.


I looked thru the help file and the .NET forums in CCS, but didn’t found anything. So I’m writing this thread to see what could be the correct way to accomplish this.

View profile  Send private message
Posted: 12/15/2005, 12:07 AM


The correct code will be looks as following

Dim D_EDQT01 As Object  
Dim dr As DataRowCollection  
Dim NewDao As DataAccessObject = Settings.MSDBDataAccessObject    
Dim Sql As String = “select * from table_name”    
dr = NewDao.RunSql(Sql).Tables(0).Rows  
Dim i as Integer  
For I = 0 To dr.Count  
  D_EDQT01 = dr("EDQT01")    

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by  and YesSoftware, Inc.