title: How to get datarow cell value with column name datatable
body: <p>Let Me first tell you what i am doing right now and what problem i am facing.</p>
  
  <p>Right now i am using <code>SqlDataReader</code> for fetching data from database my function looks like</p>
  
  <pre><code> public List&lt;TOPIC_REPORT&gt; gettopicreports()
          {
              query = "SELECT * FROM [Topic Reports]";
              List&lt;TOPIC_REPORT&gt; rpl = new List&lt;TOPIC_REPORT&gt;();
              try
              {
                  con.Open();
                  com = new SqlCommand(query, con);
                  sdr = com.ExecuteReader();
                  while (sdr.Read())
                  {
                      rt = new TOPIC_REPORT();
                      rt.ContentId = sdr.GetString(0);
                      rt.TimesReported = sdr.GetInt64(1);
                      rt.IsBanned = sdr.GetInt32(2);
                      rpl.Add(rt);
  
                  }
                  con.Close();
                  return rpl;
  
              }
              catch (Exception e)
              {
                  con.Close();
                  throw e;
              }
          }
  </code></pre>
  
  <p>Problems with above code</p>
  
  <ol>
  <li>Need to assign values to class variables on by one and problematic  with multiple select query.</li>
  <li>Need to take care of ResultSet , while loop etc.</li>
  </ol>
  
  <p>Above Problem solution use SqlDataAdapter.</p>
  
  <pre><code>public DataSet getdata()
          {
              com.CommandText = "GetMasterPageData";
              com.Connection = con;
              com.CommandType = CommandType.StoredProcedure;
              con.Open();
              SqlDataAdapter adapter = new SqlDataAdapter(com);
              DataSet ds = new DataSet();
              adapter.Fill(ds);
              con.Close();
              return ds;
          } 
  </code></pre>
  
  <p>This solves above stated problems but</p>
  
  <ol>
  <li>Decrease my prog readability because my front end person don't know in which order i am sending DataTables in DataSet.</li>
  <li>Don't know order of selected values in DataTable.</li>
  <li>Front end person need to work on column index which is at end will be problematic.</li>
  </ol>
  
  <p>Suggest me what should i do to solve above stated problems.  </p>