Need assistance - Looping through a Typed Dataset

  • Thread starter Thread starter RCB
  • Start date Start date
R

RCB

I created a new Vb.NET project and used the Data Form Wizard to create a
dataset and grid to view a single table from my database. Later I read an
article about creating a Typed Dataset. I was successful at doing so, but
now the following line of code does not work for looping through the records
of my dataset. Is there something I need to change to now look through a
Typed Dataset with just a single table?

Thanks!

This code used to work with the dataset created with the Data Form Wizard.
It no longer does when I manually coded for a Typed Dataset...
For i As Integer = 1 To TdsXeditGrid.Tables(0).Rows.Count - 1

TdsXeditGrid.Tables(0).Rows(i)("containserrors") = "0"
 
RCB
I dont know but this is strange
For i As Integer = 1 To TdsXeditGrid.Tables(0).Rows.Count - 1

TdsXeditGrid.Tables(0).Rows(i)("containserrors") = "0"
You dont want to change the first row?
And what if your table has only 1 row?

The index starts on 0

Cor
 
Thanks, Cor. You're correct. My mistake. The index is actually 0. I included
a typo in the code example. I did finally discover how to do the looping I
need.

RB
 
Back
Top