Broker.Insert() execption, SQL Server 2005

  • Broker.Insert(myObject) throws the following exception:

    {"Der eingehende Tabular Data Stream (TDS) für das RPC-Protokoll (Remote Procedure Call) ist nicht richtig. Parameter 27 (\"@MembraneWidth_All\"): Der angegebene Wert ist keine gültige Instanz des float-Datentyps. Überprüfen Sie die Quelldaten im Hinblick auf ungültige Werte. Ein Beispiel für einen ungültigen Wert sind Daten eines numerischen Typs, deren Dezimalstellen den Wert für die Genauigkeit überschreiten."}

    Number: 8023

    This is the same message as e.g. in\(TDS)+remote+procedure+call+(RPC)+protocol+stream+is+incorrect.#40a05b09f86f81e8

    What does this mean? Is the SQL Server provider not 100 percent compatible with

    Microsoft SQL Server 2005 - 9.00.3233.00 (Intel X86)   Mar  6 2008 22:09:47   Copyright (c) 1988-2005 Microsoft Corporation  Developer Edition on Windows NT 6.0 (Build 6001: Service Pack 1)


    --> stefan <--

    • I've tracked it down to Gentle.Framework.SqlStatement:

      internal SqlResult Execute( IDbConnection conn, IDbTransaction tr )
        case StatementType.Insert:
          sr = new SqlResult(broker, cmd.ExecuteScalar(), this);

      The (IDbCommand) cmd.ExecuteScalar() throws the error. It tries to execute a command like this:

      insert into tableName (field1, .., fieldN)
      values (@field1, .., @fieldN);
      select @@SCOPE_IDENTITY;

      It seems that the values are not taken from the object. Any clues?

      • What versions are you using.

        Care to post some code. I'm not sure I can help, but if you post your persistence object along with some calling code, I might identify something. If you're using Gentle 2.0 (in any of its "alphas" I cannot help, as I use 1.2.x (later relaunched as 1.5 if I don't remember wrong).



    • Gentle 1.2.9

      I'm trying to port an existing project from .NET 1.1/VS 2003 to .NET 2.0/VS 2008. I'm able to create and save other persistence objects. Only this on fails. It has about 68 columns in the back-end table. The objects source is about 6k lines...

      As I'm trying to narrow it down, I'm currently stuck as I don't can determine how and when (IDbCommand) cmd in SqlStatement is created. It seems that the values are not parsed into the SQL statement.

      • Hi Stefan,

        It's been a long time (a year) since I ported our application just like you, so I barely remember the details and issues we had (a few).

        I'd suggest that you try to create a small version of the Object source with less columns. Are you using any "strange" column? (Binary, Text?) Null values?

        If you have other working objects, the best way to track this down is to make it smaller until it works.


        • Thanks, good advice. There are five float fields which produce this error...