title: Show specific set of fields
body: <p>I'm trying to show a specific set of fields, extracted from SQL into my crystal report.</p>
  
  <pre><code>SqlConnection cnn;
  string connectionString = null;
  string sql = null;
  
  connectionString = "Data Source=RHYME-PC\\SQLEXPRESS;Initial Catalog=Caproj;Integrated Security=True;";
  cnn = new SqlConnection(connectionString);
  cnn.Open();
  sql = "select DriverID, FirstName, MiddleName, LastName, ContactNo, EmergencyNumber, Address, Documents, Status, ContactPerson, BirthDate, YearsOfExperience from [Driver Table]";
  SqlDataAdapter dscmd = new SqlDataAdapter(sql, cnn);
  DataSet ds = new DataSet();
  dscmd.Fill(ds, "[Driver Table]");
  MessageBox.Show(ds.Tables[6].Rows.Count.ToString());
  cnn.Close();
  
  DriverReport rpt = new DriverReport();
  rpt.SetDataSource(ds.Tables[6]);
  crystalReportViewer1.ReportSource = rpt;
  crystalReportViewer1.Refresh();
  </code></pre>
  
  <p>I get an error in the line <code>"MessageBox.Show(ds.Tables[6].Rows.Count.ToString());"</code> which says, </p>
  
  <blockquote>
    <p>An unhandled exception of type 'System.IndexOutOfRangeException'
    occurred in System.Data.dll</p>
    
    <p>Additional information: Cannot find table 6.</p>
  </blockquote>
  
  <p>How can I resolve this?</p>