CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> .NET

 .NET while/loop thru a select query result

Print topic Send  topic

Author Message
Guillermo


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

Hello,
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")  
  
RecordSet.MoveNext  
Loop

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")  
  
Request.MoveNext  
Loop

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'.

Request.MoveNext
~~~~~~~~~~~~~~~~

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.

Thanks…
Guillermo
View profile  Send private message
Stan
Posted: 12/15/2005, 12:07 AM

Guillermo

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")    
Next  
 /code] 
                   

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 http://support.yessoftware.com.

MS Access to Web

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

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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