Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1176
  • Last Modified:

Looping through a dataview object

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
stankstank
Asked:
stankstank
1 Solution
 
gregoryyoungCommented:
foreach(DataRow dr in YourDataView) {
   Console.WriteLine(dr["columnname"]);
}
0
 
stankstankAuthor Commented:
Thanks gregory, that worked perfectly. :)

-Stank
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now