title: Update database with date format
body: <p>I found some threads here in the forum related to this problem but they didn't help me. I just want to update my database with a date value. These come from a Textfile (written there as 2014-10-02 for example). Now I tried this (which was mentioned in the other threads):</p>
  
  <pre><code> String connectionQuery = form1.conString.Text;
                  SqlConnection connection = new SqlConnection(connectionQuery);
                  SqlCommand sqlComInsert = new SqlCommand(@"INSERT INTO [" + form1.tableName.Text + "] ([" + form1.CusId.Text + "],["+ form1.date.Text +"],[" + form1.cusName.Text + "]) VALUES('" + cusId[i] + "',convert(date,'" + date[i] + "',104),'" + "','" + cusName[i] + "')", connection);
  
    sqlComInsert.Connection.Open();
                  sqlComInsert.ExecuteNonQuery();
                  sqlComInsert.Connection.Close();
  </code></pre>
  
  <p>Now when I leave the "'" out ("',convert / "',104)) he tells me that the syntax is incorrect near 2013 (the beginning of my date). When I write it like above then I get:
  String or binary data would be truncated.</p>
  
  <p>What is this? I tried also to convert the date with:</p>
  
  <pre><code>  for (int i = 0; i &lt; typeDelDate.Count; i++)
              {
                  unFormatedDate = date[i];
                  formatedDate = unFormatedDate.ToString("dd/MM/yyyy");
                  dateFormat.Add(formatedDate);
              }
  </code></pre>
  
  <p>but I get still the same errors. How can I update my values? the column type is "date".</p>