We help IT Professionals succeed at work.

Loop datatable

VBdotnet2005
VBdotnet2005 asked
on
548 Views
Last Modified: 2012-05-11
On my page, when a user click submit, I am looping through datatable. One of the columns is called business representative. Sample
Steve Young. I also check if his name exists on DB. If he not not exist, I want to display and have a user select from a gridview inside Modal. Onces it is selected, how can I make Foreach loop continue to the next row? Or if even possible?

Foreach


   etc..
   if Steve young does not exits then
      modal.show                    
        select Representative name
        and insert data to dbtablesample
   end if
   continue looping to the next row


next
Comment
Watch Question

GlobaLevelProgrammer

Commented:
this?


Dim rowRunData As System.Data.DataRow
Dim ProjectData = New System.Data.DataTable()

 And Ive put the various data in the datatable.... so my code for looping I thought would be....

For Each rowRunData In ProjectData.rows
       DoStuff()
Next

But with this

Author

Commented:
For Each rowRunData In ProjectData.rows
       DoStuff()  <<< I want to display Modal extender ajax if Representative name does not exists(see my comment above)
                      inside Modal I have a gridview. I want a user to select Representative  first(I can do this no problem)
                  then I need it to continue looping afterward      
                   
Next
GlobaLevelProgrammer

Commented:
okay without seeing more code...

I think you have this covered..but..
http://blog.dreamlabsolutions.com/post/2008/11/11/ModalPopupExtender-in-a-GridView-sample.aspx

Dont forget Windows is event driven ,you need to have that event handled in your code behind:


Protected Sub modal_oncheck(subject s as sender, event e as event args) handles button1.click ' whatever youwant here..
For Each rowRunData In ProjectData.rows
       DoStuff()  <<< I want to display Modal extender ajax if ...      
                   
Next

End sub


GlobaLevelProgrammer

Commented:
Protected Sub modal_oncheck(subject s as sender, event e as event args) handles button1.click ' whatever youwant here..intellisens will guide you..For Each rowRunData In ProjectData.rows
       DoStuff()  <<< I want to display Modal extender ajax if ...      
                   
Next

End sub

Programmer
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
GlobaLevelProgrammer

Commented:
this was a section from the link above..
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.