0

I have a C# EF Core app. When I try to save data to the DB using the dbcontext.saveall(), I receive the following exception.

"The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 631 ("@p628"): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision."

My properties on the entity are doubles and EF created float columns in the DB. Should I change the data type?

Thanks

  • `double` and `float` are the same, just differently named between C# and SQL Server. The issue is probably whatever value you are trying (presumably) to insert into the DB for this column. If you know what was attempted to be inserted, I recommend you see if it conforms to https://learn.microsoft.com/en-us/sql/t-sql/data-types/float-and-real-transact-sql?view=sql-server-ver16 – Timothy G. Jul 05 '22 at 18:46
  • Also see https://stackoverflow.com/questions/7341641/entity-framework-sql-exception-the-supplied-value-is-not-a-valid-instance-of-da and https://stackoverflow.com/questions/53986727/insert-into-statement-causing-errors-due-to-parameter-7-the-supplied-va – Timothy G. Jul 05 '22 at 18:48
  • Thanks I'll check it out. For some reason it happens intermittently. – DanConsultant Jul 05 '22 at 19:00

0 Answers0