Avatar of Wigging
WiggingFlag for United States of America

asked on 

loop question

        This loop returns a few "order" numbers and perform actions.  
how can I put those "order" in comma separated value so I can use it in next page ?  


While objdr.Read()


                Dim order As String


                If ((Not objdr("co_num") Is Nothing)) And (Not IsDBNull(objdr("co_num"))) Then
                    order = objdr("co_num") 'This will avoid exception if dr2("picture") is null

                End If

 End While

  Response.Redirect(redirectPage)
ASP.NET

Avatar of undefined
Last Comment
Irzana
Avatar of Irzana
Irzana
Flag of Sri Lanka image

order =  String.Concat(order,",",objdr("co_num") )
Avatar of Wigging
Wigging
Flag of United States of America image

ASKER

@irzana , so this will loop and gather all the results and make them comma separated values?  
Avatar of Wigging
Wigging
Flag of United States of America image

ASKER

I added this to my code

While objdr.Read()


                Dim order As String


                If ((Not objdr("co_num") Is Nothing)) And (Not IsDBNull(objdr("co_num"))) Then
                    order = objdr("co_num") 'This will avoid exception if dr2("picture") is null

                End If
                Session("orderM") = String.Concat(order, ",", objdr("co_num"))
 End While

  Response.Redirect(redirectPage)


and the results of Session("orderM") =  P000496514,P000496514

But my orders are orderM P000496514  and P000496513

is my session code wrong?
ASKER CERTIFIED SOLUTION
Avatar of Irzana
Irzana
Flag of Sri Lanka image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo