private void InsertIntoUnitRegister(string ipAddress, string serialNumber, string name, string emailAddress, string phoneNumber, out string errorMessage) { errorMessage = string.Empty; using (MyDataClassesDataContext myDb = new MyDataClassesDataContext()) { UnitRegister n = new UnitRegister(); n.IPAddress = ipAddress; n.SerialNumber = serialNumber; n.Name = name; n.EmailAddress = emailAddress; n.PhoneNumber = phoneNumber; try { myDb.UnitRegisters.InsertOnSubmit(n); myDb.SubmitChanges(); } catch (Exception ex) { errorMessage = String.Format("Exception caught in SendEmail(): {0}", ex.ToString()); } } }
partial void UpdateUnitRegister(UnitRegister instance);
partial void DeleteUnitRegister(UnitRegister instance);
partial void InsertUnitRegister(UnitRegister instance);