Need assistance - Looping through a Typed Dataset

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"
 
C

Cor

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
 
R

RCB

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top