Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9208965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:43:53+00:00 2026-06-18T00:43:53+00:00

How do you loop through a strongly typed DataSet? We have the following defined

  • 0

How do you loop through a strongly typed DataSet?

We have the following defined in the DataSet designer:

DataSet name:      DataSetSchedules
DataTable name:    DataTableSchedules
TableAdapter name: DataTableDataAdapterSchedules

This is a code sample I found using Google:

Dim col As DataColumn
Dim dt as DataTable
Dim dr as DataRow
Dim strMyValue AS String = ""

dt = ds.Tables(0)

For Each dr In dt.Rows
   For Each col In dt.Columns
    StrMyValue = dr(col.ColumnName)
   Next
Next

Since a DataSet was already created in the DataSet desiner, I tried this:

Dim col As DataColumn
Dim dt as DataTable
Dim dr as DataRow
Dim strMyValue AS String = ""

dt = DataSetSchedules.Tables(0)

Intellisence told me that “Tables” was not a choice so I’m stuck.

Most of the code samples I found show that this is how to do it, but I don’t think that this applies to strongly typed DataSets.

Can you show the correct coding needed to loop through DataSetSchedules and get the value in dr(col.ColumnName)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:43:54+00:00Added an answer on June 18, 2026 at 12:43 am

    Try This :

     Dim DS as new DataSetSchedules
    
        DT = DS.Tables(0)
    
     For Each DR as DataRow In DT.Rows
       ' Code
     Next
    

    or as @Tim Suggested use the strongly typed Tables. see MSDN

    A typed DataSet is a class that derives from a DataSet. As such, it
    inherits all the methods, events, and properties of a DataSet.
    Additionally, a typed DataSet provides strongly typed methods, events,
    and properties. This means you can access tables and columns by name,
    instead of using collection-based methods

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to loop through a List of Dictionaries List<Dictionary<string,string>> to populate a DataTable.
Cannot seem to loop through the XElement and build a datatable. My XElement will
Possible Duplicate: php loop through associative arrays i have a variable which prints an
How can I loop through a datatable so that the rows display neatly underneath
I am trying to loop through the addresses i have in an array, geocode
By now, I have used the following algorithm for finding the strongly connected components
Im trying to loop through and display info from the following xml structure. <users_list>
I am new to Linq. I have been using strongly typed data-sets but like
Ok I have a View thats is strongly typed as a collection of MyObject
I'm trying to 'loop' through results like the following html is setup with javascript.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.