ASP.NET : C# : FOREIGN_KEY constraint exception
I have an asp.net application with a c# code-behind, connected to an SQL db with linq-to-entities... When I attempt to 'SaveChanges()' on the following code I get an exception (listed below). Any thoughts on what is up?

    private void setNewRide(long newRideID, int carNum)
            {
                handleCompletedRide(carNum);
                
                using (myEntities = new RamRideOpsEntities())
                {
                    Vehicle assignedCar = myEntities.Vehicles.FirstOrDefault(car => car.CarNum == carNum);
                    Ride newRide = myEntities.Rides.FirstOrDefault(ride => ride.identity == newRideID);
    
                    if (assignedCar != null && newRide != null)
                    {
                        vs_CurrentRideId = newRide.identity; //Save current ride to ViewState
                        vs_CarStatus = assignedCar.Status; //Save old status to ViewState
    
                        assignedCar.Status = "EnRoute";
                        assignedCar.CurrPassengers = newRide.NumPatrons;
                        assignedCar.StartAdd = newRide.PickupAddress;
                        assignedCar.EndAdd = newRide.DropoffAddress;
                        assignedCar.CurrentAdd = newRide.DropoffAddress;
    
                        assignedCar.Rides.Add(newRide);
    
                        newRide.TimeDispatched = DateTime.Now;
                        newRide.WaitTime = (((DateTime)newRide.TimeDispatched) - ((DateTime)newRide.TimeOfCall));
                        newRide.AssignedCar = carNum;
                        newRide.Status = "EnRoute";
    
                        myEntities.SaveChanges(); //EXCEPTION HERE!
                        SelectCarUP.DataBind();
                        SelectCarUP.Update();                    
                    }
                }
            }

THE EXCEPTION: 

The UPDATE statement conflicted with the FOREIGN KEY constraint \"FK_Rides_Vehicles\". The conflict occurred in database \"CWIS29RamRideOps\", table \"dbo.Vehicles\", column 'Identity'.\r\nThe statement has been terminated.

THE DB:

![enter image description here][1]


  [1]: http://i.stack.imgur.com/eQGvo.png
ASP.NET : C# : FOREIGN_KEY constraint exception
===

I have an asp.net application with a c# code-behind, connected to an SQL db with linq-to-entities... When I attempt to 'SaveChanges()' on the following code I get an exception (listed below). Any thoughts on what is up?

    private void setNewRide(long newRideID, int carNum)
            {
                handleCompletedRide(carNum);
                
                using (myEntities = new RamRideOpsEntities())
                {
                    Vehicle assignedCar = myEntities.Vehicles.FirstOrDefault(car => car.CarNum == carNum);
                    Ride newRide = myEntities.Rides.FirstOrDefault(ride => ride.identity == newRideID);
    
                    if (assignedCar != null && newRide != null)
                    {
                        vs_CurrentRideId = newRide.identity; //Save current ride to ViewState
                        vs_CarStatus = assignedCar.Status; //Save old status to ViewState
    
                        assignedCar.Status = "EnRoute";
                        assignedCar.CurrPassengers = newRide.NumPatrons;
                        assignedCar.StartAdd = newRide.PickupAddress;
                        assignedCar.EndAdd = newRide.DropoffAddress;
                        assignedCar.CurrentAdd = newRide.DropoffAddress;
    
                        assignedCar.Rides.Add(newRide);
    
                        newRide.TimeDispatched = DateTime.Now;
                        newRide.WaitTime = (((DateTime)newRide.TimeDispatched) - ((DateTime)newRide.TimeOfCall));
                        newRide.AssignedCar = carNum;
                        newRide.Status = "EnRoute";
    
                        myEntities.SaveChanges(); //EXCEPTION HERE!
                        SelectCarUP.DataBind();
                        SelectCarUP.Update();                    
                    }
                }
            }

THE EXCEPTION: 

The UPDATE statement conflicted with the FOREIGN KEY constraint \"FK_Rides_Vehicles\". The conflict occurred in database \"CWIS29RamRideOps\", table \"dbo.Vehicles\", column 'Identity'.\r\nThe statement has been terminated.

THE DB:

![enter image description here][1]


  [1]: http://i.stack.imgur.com/eQGvo.png