?
Solved

Looping through a dataview object

Posted on 2006-10-23
2
Medium Priority
?
1,173 Views
Last Modified: 2010-05-18
I am trying to loop through a dataview and find the information inside of the actual cell. The only information I can currently grab, is the name of the column.  Some help that is...  If I could just do something like Response.Write(dvTopMenu.Rows[i].Columns[3].Text)  then I could make this work.  

Here is pseudocode of what I am trying to accomplish:
---------------------------------------------------------------------------------
for (int i = 0; i < dvTopMenu.Count; i++)
{
    // Pseudocode here
    if(dvTopMenu's column [3] = strPagePath.LastIndexOf("/") + 1))
    {
        dlTopMenu.SelectedIndex = i;
        break;
    }
}
---------------------------------------------------------------------------------

Thank you for your help,

Stank
0
Comment
Question by:stankstank
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 500 total points
ID: 17790021
foreach(DataRow dr in YourDataView) {
   Console.WriteLine(dr["columnname"]);
}
0
 

Author Comment

by:stankstank
ID: 17790310
Thanks gregory, that worked perfectly. :)

-Stank
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question