Scenario: You want to update an existing order's shipping address in a SQL Server database using LINQ to SQL. Which LINQ to SQL method or operation is appropriate for this situation?

  • Attach
  • InsertOnSubmit
  • SubmitChanges
  • Update
SubmitChanges method is appropriate for updating existing records in a LINQ to SQL data context. After making changes to the object properties, calling SubmitChanges persists those changes to the database. Attach is used to attach existing objects to a data context, not for updates. Update is not a direct method in LINQ to SQL for updating records. InsertOnSubmit is used for inserting new records, not for updating existing ones.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *