Error: Restricted data type attribute violation

Last post 08-04-2003 10:13 AM by enrico.marzorati. 1 replies.

Sort Posts:

  • Error: Restricted data type attribute violation

    06-25-2003, 10:49 AM
    • Member
      10 point Member
    • marinaa
    • Member since 07-24-2002, 10:13 AM
    • Posts 2
    I'm using MYSQL ODBC 3.51 Driver and OdbcCommandBuilder update fields in my MySQL database. The type of the fields I'm updating is decimal(6,0) and I'm using version 1.1 of the .Net Framework.

    The error message I get is:
    "System.Data.Odbc.OdbcException: ERROR [07006] [MySQL][ODBC 3.51 Driver][mysqld-4.0.10-gamma-nt] Restricted data type attribute violation(SQL_C_NUMERIC)".


    Any idea?
    Thanks!
    Marina
  • Re: Error: Restricted data type attribute violation

    08-04-2003, 8:29 AM
    hi Marina-a,
    you can try :

    ......

    UpdateCommand.CommandText = "UPDATE Settori SET CODSET = ?, DESSET = ?,CODREP = ? WHERE CODSET = ?"


    UpdateCommand.Parameters.Add("@CODSET", OdbcType.VarChar, 2).Value = cdset
    UpdateCommand.Parameters.Add("@DESSET", OdbcType.VarChar, 30).Value = dsset
    UpdateCommand.Parameters.Add("@CODREP", OdbcType.Double).Value = Cdbl(cdrep)
    UpdateCommand.Parameters.Add("@ID", OdbcType.varchar,2).Value = cdset
    ....

    Use Double instead of Decimal, like C programming with MySql API !
Page 1 of 1 (2 items)