Link to home
Start Free TrialLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

asked on

How to access column in a datatable

Quite a while ago, while learning C#, I wrote this snippet of code, which has been working so far.  I need to get to column[6] for each row in the table and examine the contents.

How do I do this?
DataTable dt = new DataTable();
            FbDataAdapter da = new FbDataAdapter("SELECT * from tUploadInfo", mainForm.bookConn);
            da.Fill(dt);  //  fill datatable

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of regevha
regevha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rmmarsh

ASKER

I will give you the points, but this one line of code does exactly what I was looking for.

                object ei = dt.Rows[0][6];