Dataset designer resetting query parameters from Single to Decimal datatype

  • Thread starter Thread starter morleyc
  • Start date Start date
M

morleyc

Hi, i have a table with a number of real fields. I believe these
correspond directly to single/float types in C#. I create an insert
query in the dataset designer of Visual Studio 2005, and whilst in the
query builder screen i tried to test the query by hitting Execute
Query button. However, after entering the parameters (Time and Power
are the field names), an exception box pops up saying:

INSERT INTO Detail(Time,Power) VALUES (@Time,@Power)
Error source: SQL Server Mobile Edition ADO.NET Data provider
Message: @Time: Unable to cast object of type
'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible'

If i ever make any custom queries other than the standard SELECT,
UPDATE, DELETE etc that is generated the designer always sticks in
SqlDecimal, and i have to go through each parameter in the query's
propery window and reset the parameters to single again.

Should i be able to run this query from the designer? I havent had a
chance to get everything working in code so i dont know if it will
work or not with the same problem. Thanks in advance,

Chris
 
Ok i am able to run from code just now and it works ok. I still have
one nagging question though, why is the designer sticking to Decimal
everytime? What is the difference between decimal and real? Is this
normal behaviour? Apart from that all seems to be ok, if it is normal
behaviour to revert to decimal everytime the table adapter is
configured and there are no adverse affects then this would suit me as
it saves me a lot of clicking and setting fields to Single again.

Thanks,

Chris
 
Back
Top