title: Pass DateTimePicker Value to a stored procedure
body: <p>I have two <code>DateTimePicker</code> on my form <code>dtp_VacationStart</code> and <code>dtp_VacationEnd</code> . I'd like to pass its value to a stored procedure</p>
  
  <p>My SQL Code</p>
  
  <pre><code>CREATE PROC [ADD_VACATION]  @vacationStart date ,@vacationEnd date ,@vacationMem nvarchar (100) = NULL ,@idVacationKind_L int ,@idMember_L int
  
  AS INSERT INTO [tblVacation]
             ([vacationStart]
             ,[vacationEnd]
             ,[vacationMem]
             ,[idVacationKind_L]
             ,[idMember_L])
       VALUES
             (@vacationStart
             ,@vacationEnd
             ,@vacationMem
             ,@idVacationKind_L
             ,@idMember_L)
  </code></pre>
  
  <p>C# Code :</p>
  
  <pre><code>public void ADD_VACATION(string vacationStart,string vacationEnd, string vacationMem, int idVacationKind_L, int idMember_L)
  {
  
      DAL.open();
  
      SqlParameter[] param = new SqlParameter[5];
  
      param[0] = new SqlParameter("@vacationStart", SqlDbType.Date);
      param[0].Value = vacationStart;
  
      param[1] = new SqlParameter("@vacationEnd", SqlDbType.Date);
      param[1].Value = vacationEnd;
  
      param[2] = new SqlParameter("@vacationMem ", SqlDbType.NVarChar, 100);
      param[2].Value = vacationMem;
  
      param[3] = new SqlParameter("@idVacationKind_L", SqlDbType.Int);
      param[3].Value = idVacationKind_L;
  
      param[4] = new SqlParameter("@idMember_L", SqlDbType.Int);
      param[4].Value = idMember_L;
  
      DAL.ExecuteCommand("ADD_VACATION", param);
      DAL.close();
  
  }
  </code></pre>
  
  <p>And the event</p>
  
  <pre><code>private void btnAddVacation_Click(object sender, EventArgs e)
  {
  
      cms.ADD_VACATION( dtp_VacationStart.Text, dtp_VacationEnd.Text, txtVacationMemory.Text,
                      Convert.ToInt32(cmbVacationKind.SelectedValue)
                     ,Convert.ToInt32(dgMember_Grade.CurrentRow.Cells[0].Value.ToString()));
  
      MessageBox.Show("Added Successfuly", " ", MessageBoxButtons.OK, MessageBoxIcon.Information);
  }
  </code></pre>
  
  <p>This code gives me an Error : Input string was not in a correct format.</p>
  
  <p>Thanks for you all ... Sorry about confusing .. its my first question</p>