title: Read specific column in dataset
body: <p>I have a question, how to read a specific column form data set....</p>
  
  <p>I have this code:</p>
  
  <pre><code>cmd_line.CommandText = "SELECT IDOC_NUM, SEG_NUM FROM AGR3PL_LINE WHERE IDOC_NUM = '" + Lidoc_num + "'";
  
  OracleDataAdapter ora_adapter_li = new OracleDataAdapter(cmd_line);
  DataSet ds_idoc_li = new DataSet("AGR3PL_LINE");
  ora_adapter_li.Fill(ds_idoc_li, "AGR3PL_LINE");
  
  if (ds_idoc_li.Tables[0].Rows.Count == 0)
  {
     SEG_NUM_L = 1;
  }
  else
  {
     int var = Convert.ToInt32(ds_idoc_li.Tables["AGR3PL_LINE"]["SEG_NUM"]);
     SEG_NUM_L = var;
     SEG_NUM_L++;
  }
  </code></pre>
  
  <p>First I make a select to extract <code>SEG_NUM</code> variable, then I check if is there any row in dataset, if is not set <code>SEG_NUM = 1</code>, else if there is any data extract <code>SEG_NUM</code>, read it and increment it for 1.</p>
  
  <p>I have problem with this part: </p>
  
  <p>int var = Convert.ToInt32(ds_idoc_li.Tables["AGR3PL_LINE"].Rows[0]["SEG_NUM"]);</p>
  
  <p>If I have 2 entries it works fine, but if there are more than 2 entries I get an error for 3. entry: There is no line at position 0, the counter always increments for 2.</p>
  
  <p>This part is not right</p>
  
  <pre><code> Convert.ToInt32(ds_idoc_li.Tables["AGR3PL_LINE"].Rows[0]["SEG_NUM"]);
  </code></pre>