By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,257 Members | 928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,257 IT Pros & Developers. It's quick & easy.

Using foreach Loop

P: 1
I have Data Recive it from stordProceder and i want to Get this data using foreach loop to equal it with local variable
May 28 '07 #1
Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
I have Data Recive it from stordProceder and i want to Get this data using foreach loop to equal it with local variable
What have you tried so far?
How are you retrieving your data from the database?
Could you please post a snippet of code with what you've tried so far and better explain the problem?

Please check out this .Net article on how to use a database in your program.

Once you've stored all the information you've retrievd from your store proceedure into a data reader you'll have to use a while loop to get the information out of it.

Eg.
Expand|Select|Wrap|Line Numbers
  1. While myDataReader.Read
  2.     TextBox1.Text = TextBox1.Text + " " + CType( dr.Item("FieldName"), String)
  3. End While
  4.  
May 28 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.