title: sql update from vb only works partially
body: <p>I am trying to update a table in mssql2012 via VB(2012).</p>
  
  <p>If I use the first code (missing 4 fields) it works.</p>
  
  <p>With the additional 4 fields (<code>tire_id2, qty2, cost2, retail2</code>) I get the error:</p>
  
  <blockquote>
    <p>failed to convert parameter value from a string to DateTime.</p>
  </blockquote>
  
  <p>Good code:</p>
  
  <pre><code> mycommand.Connection = m_cn
      mycommand.CommandText = "INSERT INTO sales (date, cust_id, tire_id, qty, cost_ea, retail_ea, plate,mileage,service,service2,serv_price,serv2_price,total,notes,custphone) VALUES (@date, @cust_id, @tire_id,@qty, @cost, @retail,@plate,@mileage,@service,@service2,@serv_price,@serv2_price,@total,@notes,@custphone)"
  
      mycommand.Parameters.Add("@date", SqlDbType.Date).Value = txtQuoteDate.Text
      mycommand.Parameters.Add("@cust_id", SqlDbType.NVarChar).Value = cust_datatable.Rows(0).Item("custID")
      mycommand.Parameters.Add("@tire_id", SqlDbType.NVarChar).Value = (m_intRowPosition + 1)
      mycommand.Parameters.Add("@qty", SqlDbType.VarChar).Value = txtQuantity.Text
      mycommand.Parameters.Add("@cost", SqlDbType.VarChar).Value = m_DataTable.Rows(m_intRowPosition)("cost").ToString
      mycommand.Parameters.Add("@retail", SqlDbType.NVarChar).Value = txtEachPrice.Text
      mycommand.Parameters.Add("@plate", SqlDbType.VarChar).Value = txtplate.Text
      mycommand.Parameters.Add("@mileage", SqlDbType.NVarChar).Value = txtmileage.Text
      mycommand.Parameters.Add("@service", SqlDbType.NVarChar).Value = txtService1.Text
      mycommand.Parameters.Add("@serv_price", SqlDbType.VarChar).Value = txtAlignPrice.Text
      mycommand.Parameters.Add("@total", SqlDbType.NVarChar).Value = txtTotal.Text
      mycommand.Parameters.Add("@notes", SqlDbType.NVarChar).Value = txtNotes.Text
      mycommand.Parameters.Add("@custphone", SqlDbType.NVarChar).Value = txtCustPhone.Text
      mycommand.Parameters.Add("@service2", SqlDbType.NVarChar).Value = txtService2.Text
      mycommand.Parameters.Add("@serv2_price", SqlDbType.VarChar).Value = txtService2Price.Text
      mycommand.ExecuteNonQuery()
  </code></pre>
  
  <p>and "bad" code:</p>
  
  <pre><code> mycommand.Connection = m_cn
          mycommand.CommandText = "INSERT INTO sales (date, cust_id, tire_id,tire_id2, qty, qty2, cost_ea, cost_ea2, retail_ea, retail_e2, plate,mileage,service,service2,serv_price,serv2_price,total,notes,custphone) VALUES (@date, @cust_id, @tire_id, @tire_id2,@qty, @qty2, @cost, @cost2, @retail,@retail2,@plate,@mileage,@service,@service2,@serv_price,@serv2_price,@total,@notes,@custphone)"
  
          mycommand.Parameters.Add("@date", SqlDbType.Date).Value = txtQuoteDate.Text
          mycommand.Parameters.Add("@cust_id", SqlDbType.NVarChar).Value = cust_datatable.Rows(0).Item("custID")
          mycommand.Parameters.Add("@tire_id", SqlDbType.NVarChar).Value = (m_intRowPosition + 1)
          mycommand.Parameters.Add("@tire_id2", SqlDbType.NVarChar).Value = (m_introwposition2 + 1)
          mycommand.Parameters.Add("@qty", SqlDbType.VarChar).Value = txtQuantity.Text
          mycommand.Parameters.Add("@qty2", SqlDbType.VarChar).Value = txtQuantity2.Text
          mycommand.Parameters.Add("@cost", SqlDbType.VarChar).Value = m_DataTable.Rows(m_intRowPosition)("cost").ToString
          mycommand.Parameters.Add("@cost2", SqlDbType.VarChar).Value = m_datatable2.Rows(m_introwposition2)("cost").ToString
          mycommand.Parameters.Add("@retail", SqlDbType.NVarChar).Value = txtEachPrice.Text
          mycommand.Parameters.Add("@retail2", SqlDbType.NVarChar).Value = txtEachPrice2.Text
          mycommand.Parameters.Add("@plate", SqlDbType.VarChar).Value = txtplate.Text
          mycommand.Parameters.Add("@mileage", SqlDbType.NVarChar).Value = txtmileage.Text
          mycommand.Parameters.Add("@service", SqlDbType.NVarChar).Value = txtService1.Text
          mycommand.Parameters.Add("@serv_price", SqlDbType.VarChar).Value = txtAlignPrice.Text
          mycommand.Parameters.Add("@total", SqlDbType.NVarChar).Value = txtTotal.Text
          mycommand.Parameters.Add("@notes", SqlDbType.NVarChar).Value = txtNotes.Text
          mycommand.Parameters.Add("@custphone", SqlDbType.NVarChar).Value = txtCustPhone.Text
          mycommand.Parameters.Add("@service2", SqlDbType.NVarChar).Value = txtService2.Text
          mycommand.Parameters.Add("@serv2_price", SqlDbType.VarChar).Value = txtService2Price.Text
          mycommand.ExecuteNonQuery()
  </code></pre>
  
  <p>Any thoughts?
  here is my "CREATE" statement for the sql table:</p>
  
  <pre><code>CREATE TABLE [dbo].[sales](
  [date] [date] NULL,
  [cust_id] [int] NULL,
  [tire_id] [int] NULL,
  [qty] [int] NULL,
  [cost_ea] [decimal](5, 2) NULL,
  [retail_ea] [decimal](5, 2) NULL,
  [plate] [nchar](10) NULL,
  [mileage] [nchar](10) NULL,
  [service] [nchar](30) NULL,
  [serv_price] [nchar](10) NULL,
  [total] [nchar](10) NULL,
  [notes] [nvarchar](150) NULL,
  [custphone] [nchar](10) NULL,
  [service2] [nchar](30) NULL,
  [serv2_price] [nchar](10) NULL,
  [inv_no] [int] IDENTITY(1,1) NOT NULL,
  [tire_id2] [int] NULL,
  [qty2] [int] NULL,
  [cost_ea2] [decimal](5, 2) NULL,
  [retail_ea2] [decimal](5, 2) NULL,
  [tire_id3] [int] NULL,
  [qty3] [int] NULL,
  [cost_ea3] [decimal](5, 2) NULL,
  [retail_ea3] [decimal](5, 2) NULL,
  CONSTRAINT [PK_sales] PRIMARY KEY CLUSTERED)
  </code></pre>