Datagrid - pulling a cell value from a column - Any help would be GREATLY appreciated.

  • Thread starter Thread starter PuckInLA
  • Start date Start date
P

PuckInLA

I have a question. I have some data that I am pulling into a dataset
that needs to have each row of data emailed out. I got the email
funciton working great but its extracting that data that is becoming
the problem. I assume it would be in a loop, and to do that I am
guessing something like this:

for each item in dataset
extact row
email rowinfo
for next

(my theoritical coding practices, pardon me :)

Does anyone have an idea how i can do this?

Dim i As Integer
Dim strContainerID As String
Dim num As Integer =
Me.BindingContext(dgNewContainer.DataSource).Count
strContainerID = num

lblToday.Text = strContainerID
--->>> I want to pull a cell value out of a column to email it here
For i = 0 To num - 1


Next
End Sub
 
I'm guessing you are binding a specific data table from that dataset,
and would like to interate over only the rows in that table.
The way to do this is to simply go over the specific table tows and
columns like so:

for each row as DataRow in ds.table(0).Rows
for each col DataColumn in ds.tables(0).Columns
dim currentRowCell as String = row(col.Name).Value
'do whatever you like with this value
next

next
 
Back
Top