c# - "Specified cast is not valid" error when saving LINQ-To-SQL entity -


app details: c#, asp.net mvc, sql server 2008 ( same version & sp level), linq-to-sql orm

i'm trying diagnose exception i'm receiving:

"specified cast not valid." @ system.data.linq.identitymanager.standardidentitymanager.singlekeymanage`2.trycreatekeyfromvalues(object[] values, v& v)
@ system.data.linq.identitymanager.standardidentitymanager.identitycache`2.find(object[] keyvalues)
@ system.data.linq.identitymanager.standardidentitymanager.find(metatype type, object[] keyvalues)
@ system.data.linq.commondataservices.getcachedobject(metatype type, object[] keyvalues)
@ system.data.linq.changeprocessor.getotheritem(metaassociation assoc, object instance)
@ system.data.linq.changeprocessor.buildedgemaps()
@ system.data.linq.changeprocessor.submitchanges(conflictmode failuremode)
@ system.data.linq.datacontext.submitchanges(conflictmode failuremode)
@ system.data.linq.datacontext.submitchanges()
@ repository.save() @ etc....

the problem occurring on our servers, not on our local development boxes. i've tracked down single property we're modifying:

event.salesforceid = "701q0000000aotiia4"; 

if comment out line, works fine.

i've tried:

1 ) waxing of code on server , redeploying. same issue.
2 ) pulling down copy of server db , trying locally. works fine.
3 ) trying iis environment have setup on same box. same issue.
4 ) physically comparing ( using adeptsql ) both local , remote schemas. no differences.
5 ) verifying datatypes of both columns ( local , remote ) same. also, column fk table. verified both of same data type, down collation.

the server windows server 2008 , local box windows 7 x64. both have important updates setup.

the thing can think of perhaps since database , web server on different boxes issue? otherwise, i'm stumped.

any ideas?

this well-known bug in linq sql.

https://connect.microsoft.com/visualstudio/feedback/viewfeedback.aspx?feedbackid=351358

there hotfix issue.

http://support.microsoft.com/hotfix/kbhotfix.aspx?kbnum=963657&kbln=en-us


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -