Accessing Value from System.Data.DataTable : Tip

Technically, the best approach here for speed and flexibility is to do the following:public class TestClass{ private const string EMP_ID = "EmpId"; public void MyTestMethod() { //GetData fetches data from the database using a SQL query DataTable dt =...

Technically, the best approach here for speed and flexibility is to do the following:

Comments and Discussions

I personally like using Stopwatch over DateTime, but that'll work as well. Including the time to retrieve the columns, I get only about a 2x speed improvement using DataColumns. Not as fast as you got, but still significantly faster.