Microsoft Visual Studio DataSet designer generates code (C#/VB.NET) to read data from a .NET Data Provider data source or apply changes to the data source. DataSet designer generates parameterized queries and sets the properties of DbParameter object to the corresponding column data type attributes. For example it sets DbParameter.DbType to DbType.String or DbType.Decimal. It also sets the DbParameter.Size to the column size which is the maximum number of characters for Char/VarChar columns.

However DataSet designer fails to set the Precision and Scale properties for the following data types:

  • Decimal
  • Time
  • Time with Time Zone
  • TimeStamp
  • TimeStamp With Time Zone
  • Interval Day-To-Second Data Type

This will result in loss of precision in some cases. For example .NET Data Provider for Teradata will truncate the sub-seconds for Time or TimeStamp data types.

Microsoft released two hot-fix for this issue; one hot-fix is for .NET Framework 2.0 SP1 and the other is applicable to .NET Framework 2.0 SP2.

This hot-fix sets the Precision and Scale for Decimal Data Type automatically; but it does not set the precision and scale for DateTime and Intervals data types automatically. You must use the Parameter Collection Editor to set the precision and scale manually.