Ich habe irwie immer nur komische Probleme
Naja wie dem auch sei.
Ich habe eine SQLite Datenbank.
Aufbau is easy:
per dblinq2007 habe ich nun eine Main.cs gemacht:
LONG
Der Aufruf dabei:
Wenn ich nun diesen Code ausführe:
instance is ne Instanz von Server.
data is ne Instanz von Main.
bekomme ich bei SubmitChanges() folgenden Fehler:
StackTrace:
Jemand ne Idee, wie ichs beheben kann?
Naja wie dem auch sei.
Ich habe eine SQLite Datenbank.
Aufbau is easy:
per dblinq2007 habe ich nun eine Main.cs gemacht:
C#-Quellcode
- //
- // ____ _ __ __ _ _
- // | _ \| |__ | \/ | ___| |_ __ _| |
- // | | | | '_ \| |\/| |/ _ \ __/ _` | |
- // | |_| | |_) | | | | __/ || (_| | |
- // |____/|_.__/|_| |_|\___|\__\__,_|_|
- //
- // Auto-generated from main on 2012-07-05 16:44:51Z.
- // Please visit http://code.google.com/p/dblinq2007/ for more information.
- //
- namespace Social_Network.NET_Server.Databases
- {
- using System;
- using System.ComponentModel;
- using System.Data;
- #if MONO_STRICT
- using System.Data.Linq;
- #else // MONO_STRICT
- using DbLinq.Data.Linq;
- using DbLinq.Vendor;
- #endif // MONO_STRICT
- using System.Data.Linq.Mapping;
- using System.Diagnostics;
- public partial class Main : DataContext
- {
- #region Extensibility Method Declarations
- partial void OnCreated();
- #endregion
- public Main(string connectionString) :
- base(connectionString)
- {
- this.OnCreated();
- }
- public Main(string connection, MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- this.OnCreated();
- }
- public Main(IDbConnection connection, MappingSource mappingSource) :
- base(connection, mappingSource)
- {
- this.OnCreated();
- }
- public Table<Settings> Settings
- {
- get
- {
- return this.GetTable<Settings>();
- }
- }
- public Table<Users> Users
- {
- get
- {
- return this.GetTable<Users>();
- }
- }
- }
- #region Start MONO_STRICT
- #if MONO_STRICT
- public partial class Main
- {
- public Main(IDbConnection connection) :
- base(connection)
- {
- this.OnCreated();
- }
- }
- #region End MONO_STRICT
- #endregion
- #else // MONO_STRICT
- public partial class Main
- {
- public Main(IDbConnection connection) :
- base(connection, new DbLinq.Sqlite.SqliteVendor())
- {
- this.OnCreated();
- }
- public Main(IDbConnection connection, IVendor sqlDialect) :
- base(connection, sqlDialect)
- {
- this.OnCreated();
- }
- public Main(IDbConnection connection, MappingSource mappingSource, IVendor sqlDialect) :
- base(connection, mappingSource, sqlDialect)
- {
- this.OnCreated();
- }
- }
- #region End Not MONO_STRICT
- #endregion
- #endif // MONO_STRICT
- #endregion
- [Table(Name="main.settings")]
- public partial class Settings
- {
- private sbyte _canReadAbout;
- private sbyte _canReadBirthDate;
- private sbyte _canReadID;
- private sbyte _canReadMail;
- private sbyte _canReadRegDate;
- private sbyte _inSearch;
- private sbyte _showOnline;
- private string _uid;
- #region Extensibility Method Declarations
- partial void OnCreated();
- partial void OnCanReadAboutChanged();
- partial void OnCanReadAboutChanging(sbyte value);
- partial void OnCanReadBirthDateChanged();
- partial void OnCanReadBirthDateChanging(sbyte value);
- partial void OnCanReadIDChanged();
- partial void OnCanReadIDChanging(sbyte value);
- partial void OnCanReadMailChanged();
- partial void OnCanReadMailChanging(sbyte value);
- partial void OnCanReadRegDateChanged();
- partial void OnCanReadRegDateChanging(sbyte value);
- partial void OnInSearchChanged();
- partial void OnInSearchChanging(sbyte value);
- partial void OnShowOnlineChanged();
- partial void OnShowOnlineChanging(sbyte value);
- partial void OnUIDChanged();
- partial void OnUIDChanging(string value);
- #endregion
- public Settings()
- {
- this.OnCreated();
- }
- [Column(Storage="_canReadAbout", Name="canReadAbout", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte CanReadAbout
- {
- get
- {
- return this._canReadAbout;
- }
- set
- {
- if ((_canReadAbout != value))
- {
- this.OnCanReadAboutChanging(value);
- this._canReadAbout = value;
- this.OnCanReadAboutChanged();
- }
- }
- }
- [Column(Storage="_canReadBirthDate", Name="canReadBirthDate", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte CanReadBirthDate
- {
- get
- {
- return this._canReadBirthDate;
- }
- set
- {
- if ((_canReadBirthDate != value))
- {
- this.OnCanReadBirthDateChanging(value);
- this._canReadBirthDate = value;
- this.OnCanReadBirthDateChanged();
- }
- }
- }
- [Column(Storage="_canReadID", Name="canReadId", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte CanReadID
- {
- get
- {
- return this._canReadID;
- }
- set
- {
- if ((_canReadID != value))
- {
- this.OnCanReadIDChanging(value);
- this._canReadID = value;
- this.OnCanReadIDChanged();
- }
- }
- }
- [Column(Storage="_canReadMail", Name="canReadMail", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte CanReadMail
- {
- get
- {
- return this._canReadMail;
- }
- set
- {
- if ((_canReadMail != value))
- {
- this.OnCanReadMailChanging(value);
- this._canReadMail = value;
- this.OnCanReadMailChanged();
- }
- }
- }
- [Column(Storage="_canReadRegDate", Name="canReadRegDate", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte CanReadRegDate
- {
- get
- {
- return this._canReadRegDate;
- }
- set
- {
- if ((_canReadRegDate != value))
- {
- this.OnCanReadRegDateChanging(value);
- this._canReadRegDate = value;
- this.OnCanReadRegDateChanged();
- }
- }
- }
- [Column(Storage="_inSearch", Name="inSearch", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte InSearch
- {
- get
- {
- return this._inSearch;
- }
- set
- {
- if ((_inSearch != value))
- {
- this.OnInSearchChanging(value);
- this._inSearch = value;
- this.OnInSearchChanged();
- }
- }
- }
- [Column(Storage="_showOnline", Name="showOnline", DbType="tinyint", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public sbyte ShowOnline
- {
- get
- {
- return this._showOnline;
- }
- set
- {
- if ((_showOnline != value))
- {
- this.OnShowOnlineChanging(value);
- this._showOnline = value;
- this.OnShowOnlineChanged();
- }
- }
- }
- [Column(Storage="_uid", Name="uid", DbType="text", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public string UID
- {
- get
- {
- return this._uid;
- }
- set
- {
- if (((_uid == value)
- == false))
- {
- this.OnUIDChanging(value);
- this._uid = value;
- this.OnUIDChanged();
- }
- }
- }
- }
- [Table(Name="main.users")]
- public partial class Users
- {
- private string _about;
- private System.DateTime _birth;
- private string _follows;
- private string _mail;
- private string _nick;
- private string _password;
- private System.DateTime _reGdAte;
- private string _uid;
- #region Extensibility Method Declarations
- partial void OnCreated();
- partial void OnAboutChanged();
- partial void OnAboutChanging(string value);
- partial void OnBirthChanged();
- partial void OnBirthChanging(System.DateTime value);
- partial void OnFollowsChanged();
- partial void OnFollowsChanging(string value);
- partial void OnMailChanged();
- partial void OnMailChanging(string value);
- partial void OnNickChanged();
- partial void OnNickChanging(string value);
- partial void OnPasswordChanged();
- partial void OnPasswordChanging(string value);
- partial void OnReGDateChanged();
- partial void OnReGDateChanging(System.DateTime value);
- partial void OnUIDChanged();
- partial void OnUIDChanging(string value);
- #endregion
- public Users()
- {
- this.OnCreated();
- }
- [Column(Storage="_about", Name="about", DbType="text", AutoSync=AutoSync.Never)]
- [DebuggerNonUserCode()]
- public string About
- {
- get
- {
- return this._about;
- }
- set
- {
- if (((_about == value)
- == false))
- {
- this.OnAboutChanging(value);
- this._about = value;
- this.OnAboutChanged();
- }
- }
- }
- [Column(Storage="_birth", Name="birth", DbType="datetime", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public System.DateTime Birth
- {
- get
- {
- return this._birth;
- }
- set
- {
- if ((_birth != value))
- {
- this.OnBirthChanging(value);
- this._birth = value;
- this.OnBirthChanged();
- }
- }
- }
- [Column(Storage="_follows", Name="follows", DbType="text", AutoSync=AutoSync.Never)]
- [DebuggerNonUserCode()]
- public string Follows
- {
- get
- {
- return this._follows;
- }
- set
- {
- if (((_follows == value)
- == false))
- {
- this.OnFollowsChanging(value);
- this._follows = value;
- this.OnFollowsChanged();
- }
- }
- }
- [Column(Storage="_mail", Name="mail", DbType="text", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public string Mail
- {
- get
- {
- return this._mail;
- }
- set
- {
- if (((_mail == value)
- == false))
- {
- this.OnMailChanging(value);
- this._mail = value;
- this.OnMailChanged();
- }
- }
- }
- [Column(Storage="_nick", Name="nick", DbType="text", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public string Nick
- {
- get
- {
- return this._nick;
- }
- set
- {
- if (((_nick == value)
- == false))
- {
- this.OnNickChanging(value);
- this._nick = value;
- this.OnNickChanged();
- }
- }
- }
- [Column(Storage="_password", Name="password", DbType="text", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public string Password
- {
- get
- {
- return this._password;
- }
- set
- {
- if (((_password == value)
- == false))
- {
- this.OnPasswordChanging(value);
- this._password = value;
- this.OnPasswordChanged();
- }
- }
- }
- [Column(Storage="_reGdAte", Name="regdate", DbType="datetime", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public System.DateTime ReGDate
- {
- get
- {
- return this._reGdAte;
- }
- set
- {
- if ((_reGdAte != value))
- {
- this.OnReGDateChanging(value);
- this._reGdAte = value;
- this.OnReGDateChanged();
- }
- }
- }
- [Column(Storage="_uid", Name="uid", DbType="text", AutoSync=AutoSync.Never, CanBeNull=false)]
- [DebuggerNonUserCode()]
- public string UID
- {
- get
- {
- return this._uid;
- }
- set
- {
- if (((_uid == value)
- == false))
- {
- this.OnUIDChanging(value);
- this._uid = value;
- this.OnUIDChanged();
- }
- }
- }
- }
- }
Der Aufruf dabei:
Wenn ich nun diesen Code ausführe:
instance is ne Instanz von Server.
data is ne Instanz von Main.
bekomme ich bei SubmitChanges() folgenden Fehler:
StackTrace:
Quellcode
- bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
- bei System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
- bei DbLinq.Data.Linq.Implementation.EntityTracker.FindByIdentity(IdentityKey identityKey) in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\Implementation\EntityTracker.cs:Zeile 69.
- bei DbLinq.Data.Linq.Implementation.EntityTracker.RegisterToWatch(Object entity, IdentityKey identityKey) in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\Implementation\EntityTracker.cs:Zeile 128.
- bei DbLinq.Data.Linq.DataContext.MoveToAllTrackedEntities(Object entity, Boolean insert) in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\DataContext.cs:Zeile 576.
- bei DbLinq.Data.Linq.DataContext.InsertEntity(Object entity, QueryContext queryContext) in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\DataContext.cs:Zeile 511.
- bei DbLinq.Data.Linq.DataContext.SubmitChangesImpl(ConflictMode failureMode) in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\DataContext.cs:Zeile 451.
- bei DbLinq.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\DataContext.cs:Zeile 406.
- bei DbLinq.Data.Linq.DataContext.SubmitChanges() in z:\Development\DbLinq-0.20.1\src\DbLinq\Data\Linq\DataContext.cs:Zeile 368.
- bei Social_Network.NET_Server.server.Connection.runCommand(String line) in D:\Git\SocialNetwork.NET\source\Social Network.NET Server\server.cs:Zeile 322.
- bei System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
- bei System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
Jemand ne Idee, wie ichs beheben kann?