title: String or binary data would be truncated. The statement has been terminated
body: <pre class="lang-vb prettyprint-override"><code>Protected Sub cmdOK_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdOK.Click
          Dim medID, medName, comment As String
          Dim power, period, qtty As Integer
          'Dim nextDateOfDelivery As Date = getNextDateOfDelivery(Val(txtDays.Text))
          Dim today As System.DateTime
          Dim answer As System.DateTime
          today = System.DateTime.Now
          answer = today.AddDays(Val(txtDays.Text))
          Dim nextDateOfDelivery As Date = answer
  
  
          medName = Trim(txtMedName.Text)
          qtty = Val(txtQuantity.Text)
          comment = txtComment.Text
          power = txtPower.Text
          medID = lblMedID.Text
          period = Val(txtDays.Text)
          '............setting priorities
          '.......value of p(0) indicates priority for tablest and so on so forth.....
          Dim p() As Integer = {0, 0, 0, 0}
          For i = 0 To LBPriorities.Items.Count - 1
              Select Case LBPriorities.Items(i).Text
                  Case "Tablet"
                      p(0) = i + 1
                  Case "Capsule"
                      p(1) = i + 1
                  Case "Liquid"
                      p(2) = i + 1
                  Case "Injection"
                      p(3) = i + 1
  
              End Select
  
          Next
  
          '............if not available
          Dim strictlyThis As String = radNotAvailable.SelectedItem.Value
          Dim connStr As String = ConfigurationManager.ConnectionStrings("databaseConnectionString").ConnectionString
  
          Dim con As New SqlClient.SqlConnection(connStr)
          'Dim con As New SqlClient.SqlConnection("Data Source=.\SQLEXPRESS;" &amp; _
          '                                       "AttachDbFilename=|DataDirectory|\database.mdf;" &amp; _
          '                                       "Integrated Security=True;User Instance=True")
  
          Dim sql As New SqlClient.SqlCommand("INSERT INTO medicine" &amp; _
              "(medID, userID, medName, quantity, dateOfOrder, power, tabPriority, capPriority, liqPriority, " &amp; _
              "injPriority, period, notAvailable, prescription, comment, nextDateOfDelivery)" &amp; _
              "VALUES('" &amp; medID &amp; "','" &amp; User.Identity.Name &amp; "','" &amp; medName &amp; "'," &amp; qtty &amp; ",'" &amp; today &amp; "'," &amp; power &amp; _
              "," &amp; p(0) &amp; "," &amp; p(1) &amp; "," &amp; p(2) &amp; "," &amp; p(3) &amp; ",'" &amp; period &amp; "','" &amp; strictlyThis &amp; "', '' ,'" &amp; comment &amp; "','" &amp; nextDateOfDelivery &amp; "')", con)
  
          con.Open()
          sql.ExecuteNonQuery()
          con.Close()
          con.Dispose()
  
          lblMessage.Text = "The details of the medicine have been saved. You may upload a prescription"
          FUPrescription.Enabled = True
          cmdUpload.Enabled = True
      End Sub
  </code></pre>
  
  <p>this is what i am using now...but i get an error saying "String or binary data would be truncated.
  The statement has been terminated." what does this mean???is there something wrong with my sql statement???</p>