title: "Error converting data type nvarchar to numeric."
body: <p>I want to Insert record to the database with a ComboBox. The ComboBox is connected to the other table and this is the error:</p>
  
  <blockquote>
    <p>Error converting data type nvarchar to numeric.</p>
  </blockquote>
  
  <pre><code>private void InsertReceipt()
  {
      SqlCommand cmd = new SqlCommand();
      cmd.Connection = cn;
      cmd.CommandType = CommandType.Text;
      cmd.CommandText = "INSERT INTO Ticket(CustomerID, Date, Store, Amount, NoStub)" +
                        "VALUES (@CustomerID, @Date, @Store, @Amount, @NoStub) ";
      cmd.Parameters.AddWithValue("@CustomerID", cboName.SelectedValue);
      cmd.Parameters.AddWithValue("@Date", dtpDate.Value.Date.ToString());
      cmd.Parameters.AddWithValue("@Store", txtStore.Text);
      cmd.Parameters.AddWithValue("@Amount", txtAmount.Text);
      cmd.Parameters.AddWithValue("@NoStub", txtStub.Text);
      cmd.ExecuteNonQuery();
  }
  
  void GetRecords2()
  {
      SqlCommand cmd = new SqlCommand();
      cmd.Connection = cn;
      cmd.CommandText = "SELECT CustomerID, firstname + ',  ' + lastname AS Name  FROM Customer";
  
      SqlDataAdapter adp = new SqlDataAdapter(cmd);
      DataSet ds = new DataSet();
      adp.Fill(ds, "Customer");
  
      cboName.DataSource = ds;
      cboName.DisplayMember = "Customer.Name";
      cboName.ValueMember = "Customer.CustomerID";
  }
  </code></pre>