DataTable ?

  • Thread starter Thread starter John S
  • Start date Start date
J

John S

How do I iterate through a DataTable and retrieve the values from each row?
 
<pseudo-code>
foreach(DataRow dr in DataTable.Rows)
{
object[] items = dr.ItemArray();
foreach(object obj in items)
{
Console.WriteLine("Type: {0} -- Value: {1}", obj.GetType(), obj);
}
}
</pseudo-code>

--
HTH

Kyril Magnos
"I'm not a developer anymore, I'm a software engineer now!" :-)

| How do I iterate through a DataTable and retrieve the values from each
row?
|
|
 

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

Back
Top