Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Newbie - group looping process
Message
From
10/09/2006 12:21:42
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Newbie - group looping process
Environment versions
Environment:
VB 8.0
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Jet/Access Engine
Miscellaneous
Thread ID:
01152652
Message ID:
01152652
Views:
63
Dear All,
I am very new to VB.NET, I am using VB.NET 2005 and currently I am trying to do stock group looping process ..(see below)

I need advise from the expert .. do I already have correct codes for such stock group looping process below?
Try
    cn.Open()
    Dim cmd As New OleDbCommand("SELECT * FROM STOCKS ORDER BY STOCKGROUP,STOCKCODE", cn)
    Dim dr As OleDbDataReader = cmd.ExecuteReader()
    Dim mStockGroup as  string, mStockCode as string, mStockName as string
    If dr.HasRows Then
        Do While dr.Read
            mStockGroup = dr("StockGroup")                  
            Do While dr.Read and dr("StockGroup") = mStockGroup          ' I am not sure for this part !
                    mStockCode = dr("StockCode")
                    mStockName = dr("StockName")
                    messagebox.show(mStockCode & "   " & mStockName)
            Loop
       Loop
End if
dr.Close()
Catch ex As OleDb.OleDbException
MessageBox.show(ex.Message)
Catch ex As Exception
MessageBox.show(ex.Message)
Finally
cn.Close()
End Try
Next
Reply
Map
View

Click here to load this message in the networking platform