The null value cannot be assigned to a member with type System.Int64 which is a non-nullable value type
I'm getting the following error in my MVC2 app using Linq to SQL (I am new to both). I am connected to an actual SQL server not weird mdf:

    System.InvalidOperationException The null value cannot be assigned to a member with type System.Int64 which is a non-nullable value type

My SQL table has a column called MessageID. It is BigInt type and has a primary key, NOT NULL and an IDENTITY 1 1, no Default

In my dbml designer it has the following declaration for this field:

    [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();
    		}
    	}
    }

It keeps telling me that null cannot be assigned - I'm not passing through null! It's a long - it can't even be null!

Am I doing something stupid? I can't find a solution anywhere!

I made this work by changing the type of this property to `Nullable<long>` but surely this can't be right?
The null value cannot be assigned to a member with type System.Int64 which is a non-nullable value type
===

I'm getting the following error in my MVC2 app using Linq to SQL (I am new to both). I am connected to an actual SQL server not weird mdf:

    System.InvalidOperationException The null value cannot be assigned to a member with type System.Int64 which is a non-nullable value type

My SQL table has a column called MessageID. It is BigInt type and has a primary key, NOT NULL and an IDENTITY 1 1, no Default

In my dbml designer it has the following declaration for this field:

    [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();
    		}
    	}
    }

It keeps telling me that null cannot be assigned - I'm not passing through null! It's a long - it can't even be null!

Am I doing something stupid? I can't find a solution anywhere!

I made this work by changing the type of this property to `Nullable<long>` but surely this can't be right?