Link to home
Start Free TrialLog in
Avatar of Jimbo99999
Jimbo99999Flag for United States of America

asked on

VB.Net - DataTable One Row

Good Day Experts!

I have a DataTable only contains 1 record.  In the past, I have only used for each loop to process the DataTable.  

For Each sqlRS In sqlRStbl.Rows

Next

How can I just get the row from the DataTable?

Thanks,
jimbo99999
ASKER CERTIFIED SOLUTION
Avatar of Kyle Abrahams, PMP
Kyle Abrahams, PMP
Flag of United States of America image

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
SOLUTION
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 Jimbo99999

ASKER

Thanks for replying. I was not getting an error with the loop.  I had always processed DataTables with a ForEach loop.  But this DataTable is only being populated with 1 row of data.  I just never knew how to interrogate the DataTable for only 1 row.

 This all stems from when I was using a DataReader that I couldn't close before calling a subroutine.  I passed the subroutine the connection string used by the DataReader and was trying to execute a DataReader on that same connection and was getting an error.  So, I converted the DataReader to a DataTable in the calling routine to alleviate the problem.  

Thanks for the help,
jimbo99999