none
Writing data to sql via WCF/LINQ, null exception?

    General discussion

  • Hi,

    Probably something simple but i am trying to add data to sql from a silver light application by passing it a list of data(of type of a table). But when i try and pass the data across to the dataservice it is null when it is recieved?

    if it helps the methods i am using are:

    [OperationContract]
            public EmployeeShiftPlan AddShift(List<EmployeeShiftPlan> lsShifts)
            {
                using (tapLinqDataContext db = new tapLinqDataContext())
                {
                    foreach (EmployeeShiftPlan x in lsShifts)
                    {
                        db.EmployeeShiftPlans.InsertOnSubmit(x);
                        db.SubmitChanges();
                    }
    
                }
                return lsShifts[0];
                
            }
    private void btnSaveClose_Click(object sender, RoutedEventArgs e)
            {
                DataServiceClient svc = new DataServiceClient();
                svc.AddShiftCompleted += new EventHandler<AddShiftCompletedEventArgs>(svc_AddShiftCompleted);
                svc.AddShiftAsync(lsNewShifts);
            }
    Wednesday, October 19, 2011 3:45 AM

All replies

  • Dear Craig,

    let us know the exact error or issue or exception you are facing in this code?

    Thursday, October 20, 2011 5:18 AM