none
Update/debugging failure in LinqToSQL RRS feed

  • General discussion

  • Forget it!  Cancel the emergency.  Dumb programming mistake. 

    The reason it was failing was that changing that particular field was kicking off a trigger that was in turn crashing.

    I'm not sure where to begin on this one.  I'm new to LinqToSQL.  So far it's been rather easy.  I have a dbml I created by dragging the tables off the Server Explorer (no other modifications.)  I have several screens I've successfully bound to it.  (Telerik RadGrids in an Asp.Net project, Visual Studio 2012.)

    In this one screen, I have a bound dropdown.  This is the problem  I cannot save it's changes to the database table.

    The data is definitely getting into the class object that's being send for updating.  But in the DBML, the debugger is acting a bit funny as well.  I'm going to post the code below.  The debugger will not stop on the line: this.OnField1Changing.  Also if I try to do a QuickWatch on that line anyway, I get this error message: 

    this.OnField1Changing(value) 'HSSDData.Ticket' does not contain a definition for 'OnField1Changing' and no extension method 'OnField1Changing' accepting a first argument of type 'HSSDData.Table1' could be found (are you missing a using directive or an assembly reference?)
    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Field1", DbType="Int NOT NULL")]

    public int Field1
    {
    get
    {
    return this._Field1;
    }
    set
    {
    if ((this._Field1 != value))
    {
    if (this._Phase.HasLoadedOrAssignedValue)
    {
    throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
    }
    this.OnField1Changing(value);
    this.SendPropertyChanging();
    this._Field1 = value;
    this.SendPropertyChanged("Field1");
    this.OnField1Changed();
    }
    }
    }


    Wednesday, October 31, 2012 12:41 AM