none
@PARAM1 : Unable to cast object of type 'System.Data.SqlTypes.SqlInt32 to type System.IConvertable

    Question

  • I get the following message in the vs2005 querybuilder when i do a preview:

     

    ***********************************
    SQL Execution Error.

    Executed SQL statement: SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = @PARAM1)

     

    Error Source: SQL Server Compact Edition ADO.NET Data Provider


    Error Message: @PARAM1 : Unable to cast object of type 'System.Data.SqlTypes.SqlInt32 to type System.IConvertable'.
    ****************************************

    The same querypreview works fine without the parameter:

     

    SELECT Schoolindex, Variant, VVSchool, [index], indincl, VVRuimtes, School FROM School WHERE (Schoolindex = 186)

     

    Can anybody tell me why this is?
    And tell me a way to get the tableadapter working?

     

    Anne-Jan Tuinstra

    Monday, April 23, 2007 7:28 PM

Answers

  • What you can't see in the dataset editor is the datatype of the columns in the sdf database.

    It appeared that for the column Schoolindex this is smallint in the sdf.

    By changing this to int the nasty Error Message disapeared. 

     

    I think Microsoft should consider this as a bug or have it documentated somewhere!

    Wednesday, April 25, 2007 2:14 PM

All replies

  • Has it something to do with the fact that the dataset of wich the table school is a part, is a converted access mdb?
    Tuesday, April 24, 2007 10:44 AM
  • What you can't see in the dataset editor is the datatype of the columns in the sdf database.

    It appeared that for the column Schoolindex this is smallint in the sdf.

    By changing this to int the nasty Error Message disapeared. 

     

    I think Microsoft should consider this as a bug or have it documentated somewhere!

    Wednesday, April 25, 2007 2:14 PM