string or binary data would be truncated

  • Thread starter Thread starter Bernie Yaeger
  • Start date Start date
B

Bernie Yaeger

What causes the error 'string or binary data would be truncated'? Here's
the routine that sometimes causes the error, sometimes not:

irow("ctotal") = FormatCurrency(irow("total"), 2, TriState.False,
TriState.True, TriState.True)
ctotal is a char column in an sql server table; total is a currency column
in the same table. Notwithstanding, the conversion appears to be made, even
though the exception is being thrown.

Any help would be appreciated.

Bernie Yaeger
 
Bernie,

If the variable lengths dont match, then this error occurs.
Make sure that the lengths match. Atleast, make sure that the 'Converted To'
length is greater than the 'Converted From' Length.

Hemanth
 
Back
Top