The table in the SQL database has a MessageID column which is a BigInt with primary key (NOT NULL IDENTITY 1 1) no Default.
The field looks like this in the designer file to the dbml:
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MessageId", AutoSync=AutoSync.OnInsert, DbType="BigInt NOT NULL IDENTITY", IsPrimaryKey=true, IsDbGenerated=true)] public long MessageId { get { return this._MessageId; } set { if ((this._MessageId != value)) { this.OnMessageIdChanging(value); this.SendPropertyChanging(); this._MessageId = value; this.SendPropertyChanged("MessageId"); this.OnMessageIdChanged(); } } }
So the problem is that null cannot be assigned... right. But I'm not passing null! How can I be? I'm using a long (a value type so can't be null by nature).
One workaround I found was making this field nullable but this feels like a hack since it should never be null. Anyway this just moves the problem to the ID not AutoSyncing OnInsert. (AutoSync=OnInsert is set).
Great blog. Thank you! I put your feed on my RSS reader!
ReplyDeleteThesis Writing
Very interesting posts, it is really informative to read these posts Keep posting.
ReplyDeleteAffordable Essay Writing Services UK | UKEssayPapers
Such an interesting blog. Thank you for sharing such post. visit my website to see my works.
ReplyDeleteAwesome post about also check it Blog! Cider apk download Diskdigger download Mi account unlock tools
ReplyDeleteSuch a nice blog and I appreciate your all efforts about your thoughts. it’s really good work. well done. I would like to share something really helpful for education.
ReplyDeletecoursework writing service
When I Install a sendy in my database, its show me lots of error sometime it crypt my database so some of tips it's helpful for me and its clear my concept.
ReplyDeleteOnline coursework help uk
Helpful material for audience. Lets check the women fashion by Baroque
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteYour blog is awesome. You can download the Kyte TV app for free
ReplyDeleteIf you are looking for the best hp laptop under 20000 in Pakistan so you must visit this link Best hp Laptop Under 20000
ReplyDeleteVieni sul sito Web suonerie per trovare le migliori suonerie di canzoni oggi.
ReplyDelete