title: InsertCommand.Parameters.Add size parameter for datetime
body: <p>I need to know what the size parameter should be for a DateTime value using the following syntax:</p>
  
  <pre><code>adapter.InsertCommand.Parameters.Add("@deliveryDateAndTime", SqlDbType.DateTime,10,"deliveryDateAndTime");
  </code></pre>
  
  <p>I <strong>cannot</strong> use the following syntax because I'm batching the updates in a datatable.</p>
  
  <pre><code>adapter.InsertCommand.Parameters.Add("@deliveryDateAndTime", SqlDbType.DateTime);
  adapter.InsertCommand.Parameters["@deliveryDateAndTime"] = *variable*.value;
  </code></pre>
  
  <p>Below is the code I need to use (abbreviated for clarity). Note that inside the <code>adapter.InsertCommand.Parameters.Add("@deliveryDateAndTime", SqlDbType.DateTime,10,"deliveryDateAndTime");</code> statement, the <strong>first</strong> parameter refers to a corresponding SQL parameter and the <strong>4th</strong> parameter corresponds to the <strong>data for that value inside the datatable.</strong></p>
  
  <pre><code>DataTable dt = new DataTable();
  foreach (FuelDelivery fd in fuelDelivery.FuelDeliveries)
  {
      DataRow dr = dt.NewRow();
      dr["deliveryDateAndTime"] = fd.DeliveryDateAndTime;
      dt.Rows.Add(dr);
  }
  
  using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["HHSqlConnection"].ToString()))
  {
      // Create a SqlDataAdapter.
      SqlDataAdapter adapter = new SqlDataAdapter();
  
      // Set the INSERT command and parameter.
      adapter.InsertCommand.Parameters.Add("@deliveryDateAndTime", SqlDbType.DateTime,10,"deliveryDateAndTime");
      adapter.InsertCommand.UpdatedRowSource = UpdateRowSource.None;
  
      // Set the batch size. Zero represents the maximum amt of rows to update at once.
      adapter.UpdateBatchSize = 0;
  
      // Execute the update.
      int rowsUpdated = adapter.Update(dt);
  }
  </code></pre>
  
  <p>Based on this overload for the <code>adapter.InsertCommand.Parameters.Add</code> method, <strong>how can I set the date accordingly?</strong></p>