Domanda

Sto cercando di implementare SQL CE in un progetto di mango WP7, ma ora sto riscontrando questo errore quando provo a inserire/salvare un oggetto al mio DB.

Il mio codice di seguito:

public static void Save(MyObject myobject)
    {
        using (DBDataContext dc = new DBDataContext(DBDataContext.ConnectionString))
        {
            dc.MyObject.InsertOnSubmit(myobject);
            dc.SubmitChanges();
        }
    }

Quando il codice colpisce la riga di insertSubmit, si rompe con

MissingMethodException was unhandled
MissingMethodException

E questo è tutto ciò che mi dice.

Chiama Stack:

mscorlib.dll!System.Activator.InternalCreateInstance(System.Type type, bool nonPublic, ref System.Threading.StackCrawlMark stackMark) + 0xe4 bytes  
mscorlib.dll!System.Activator.CreateInstance(System.Type type) + 0x2 bytes  
System.Data.Linq.dll!System.Data.Linq.WorkAround.ActivationHelper.CreateInstance(System.Type type)  
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.StandardTrackedObject.CreateDataCopy(object instance) + 0x12 bytes    
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.StandardTrackedObject.StartTracking() + 0x16 bytes    
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.OnPropertyChanging(object sender, System.ComponentModel.PropertyChangingEventArgs args) + 0x16 bytes  
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.Attach(object obj) + 0x1f bytes   
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.Track(System.Data.Linq.Mapping.MetaType mt, object obj, System.Collections.Generic.Dictionary<object,object> visited, bool recurse, int level) + 0x4e bytes   
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.Track(object obj, bool recurse) + 0x1d bytes  
System.Data.Linq.dll!System.Data.Linq.ChangeTracker.StandardChangeTracker.Track(object obj) + 0x3 bytes 
System.Data.Linq.dll!System.Data.Linq.Table<FotoDok.EkstraFeltMulighed>.InsertOnSubmit(FotoDok.EkstraFeltMulighed entity) + 0xac bytes  

Fotodok.dll! Fotodok.ekstrafeltmullighed.gem (fotodok.ekstrafeltmulighed ekstrafeltmuluighed 70 + 0xc bytes c# fotodok.dll! Fotodok.opdaterprojekter.behandlprojekon (newtonsoft.jon. Fotodok.opdaterprojekter.readcallbackvalgteprojekter.anonymousmethod__1 (system.windows.controls.checkbox Delchk, newtonsoft.json.linq.jobject Delo) riga 141 + 0x7 bytes# mscorlibll! System.runtimectimva , Object obj, system.reflection.bindingflags invocheattr, system.reflection.binder Binder, parametri di oggetti, system.globalization.cultureInfo Culture, bool isbinderDefault, System.reflection.Assembly Caller, BOOL VERIFICESS, REF System.Treading.Stackmark Stackmark)
mscorlib.dll! System.reflection.RuntimeMethodinfo.InternalInvoke (Object Obj, System.Reflection.BindingFlags InvokeEattr, System.Reflection.binder Binder, Object [] Parameters, System.Globalization.CultureInfo Culture, Ref Ref.Thread.Stackmark) + 0x168 bytes mscorlib.dll! System.reflection.Methodbase.invoke (Object OBJ, Object [] Parametri) + 0xa bytes
mscorlib.dll! System.delegate.dynamicInvokeOne (Object [] args) + 0x98 byte
MSCORLIB.DLL! System.MUlticastDelegate.DynamicInvokeImpl (Object [] Args) + 0x8 bytes
mscorlib.dll! System.delegate.dynamicInvoke (Object [] args) + 0x2 bytes
System.Windows.dll! System.Windows.Threading.dispatcheroperation.invoke () + 0xc bytes
System.Windows.dll! System.Windows.Threading.dispatcher.dispatch (System.Windows.Threading.dispatcherpriority Priority) + 0x83 bytes
System.windows.dll! System.windows.Threading.dispatcher.oninvoke (contesto oggetto) + 0x8 bytes system.windows.dll! System.windows.hosting.CallbackCookie.invoke (Object [] Args) + 0x19 Byte System.Windows. dll! System.windows.hosting.delegatewrapper.internalInvoke (Object [] args) + 0x2 byte System.windows.runtimehost.dll! System.windows.Runtimehost.ManagedHost.Invokedelegate (System.Intptr Fandle, int nParamcount, System.Windwows. Hosting.nativemethods.scriptparam [] pparams, ref system.windows.hosting.nativemetheds.scriptparam presulto) + 0x5e byte [codice esterno

Sono riuscito a inserire altri oggetti, usando lo stesso approccio bene, ma non riesco a capire cosa rende questo oggetto diverso.

Nessuna soluzione corretta

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top