D
David
I keep getting this error on Linq to Sql when inserting or updating
(actually, I am not sure about insert, but I am definately sure about
update)
Specified cast is not valid.
I am usually fine if I am only updating one or two fields, but if I am
updating any more than that, it fails with the error.
I get this error on different tables and the only way I have found to make
it work is to remove all the associations. If I have to do that, then Linq
is not reliable and should be dropped.
If I am well into a project and I am then forced to remove associations,
just to make an insert or an update work, then I have to go back and test
EVERYTHING else to ensure removing the association doesn't break anything.
This is not really on, especially with large scale projects.
I have searched the net for how to resolve this and have seen it is fixed in
the next version of .NET. That can't be right can it? We have this problem
now.
Anyone any ideas how to work around this? I think I might have to create a
second DBML file to do inserts and updates and have no associations, but I
don't think that is really the best way to do it.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
(actually, I am not sure about insert, but I am definately sure about
update)
Specified cast is not valid.
I am usually fine if I am only updating one or two fields, but if I am
updating any more than that, it fails with the error.
I get this error on different tables and the only way I have found to make
it work is to remove all the associations. If I have to do that, then Linq
is not reliable and should be dropped.
If I am well into a project and I am then forced to remove associations,
just to make an insert or an update work, then I have to go back and test
EVERYTHING else to ensure removing the association doesn't break anything.
This is not really on, especially with large scale projects.
I have searched the net for how to resolve this and have seen it is fixed in
the next version of .NET. That can't be right can it? We have this problem
now.
Anyone any ideas how to work around this? I think I might have to create a
second DBML file to do inserts and updates and have no associations, but I
don't think that is really the best way to do it.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available