title: DataTableMapping using adapter.FillSchema method applied on a Stored Procedure
body: <p>this is a method i was reading about  @MSDN , 
  my question is if for an example i would like to use it on a stored procedure 
  with the fact that the query of that stored procedure is already specifying columns to select from the table like following :</p>
  
  <pre><code>SELECT Columnsome, columnother, , , , ...FROM thisSQLdbTable
  </code></pre>
  
  <p>though i would like to implement the approach of that specific method , it seems very advanced from a little research i have made on 
   <strong>"the best way"</strong> available to extract data from SQL Server into Asp.net DataTable.</p>
  
  <pre><code>public static DataTable GetCustomerData(string dataSetName,
  string connectionString)
  {
  DataTable table = new DataTable(dataSetName);
  
  using (SqlConnection connection = new SqlConnection(connectionString))
  {
      SqlDataAdapter adapter = new SqlDataAdapter(
          "SELECT CustomerID, CompanyName, ContactName FROM dbo.Customers", connection);
  
      DataTableMapping mapping = adapter.TableMappings.Add("Table", "Customers");
      mapping.ColumnMappings.Add("CompanyName", "Name");
      mapping.ColumnMappings.Add("ContactName", "Contact");
  
      connection.Open();
  
      adapter.FillSchema(table, SchemaType.Mapped);
      adapter.Fill(table);
      return table;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>or is it not the method to use if i am querying via <code>SP</code> that specifies the selected column</p>
  
  <p>i could actually drop that stored procedure if it is not requiered to select /specify columns </p>
  
  <p>the stored procedure is doing a specific calculation and updates the table with results of calculation then i am switching it's "MODE" to select results from the table that was updated.</p>
  
  <p>what i did is recyceling (; giving it a parameter (bit type) 
  stored procedure then asks for the value of supplied <code>bool</code> / <code>bit</code> Parameter, 
  if its is status true it updates (doing its original task it was made for)</p>
  
  <p>if its false its doing a select oporation so i am using it as i would with 2 separated commands </p>
  
  <p><strong>but now</strong> that i have search for a better way to extract data from db into a Data table </p>
  
  <p>i give up on the two way SP and i will make a selection via the exaple above if they're not intended to be used thogether as with my current SP that does preselection when servs the <code>GetCustomersData()</code> above.</p>
  
  <p>So the question is do i need to let the function to make the selection or can i serve it with my sp ready made selection to implemet it with GetCustomersData() in the way that it will only do rest of task and only mapp the columns that was preselected </p>