變更資料和提交Making and Submitting Data Changes

本節中的主題描述如何變更資料庫以及將變更傳輸至資料庫,以及如何處理開放式並行存取 (Optimistic Concurrency) 衝突。The topics in this section describe how to make and transmit changes to the database and how to handle optimistic concurrency conflicts.

注意

您可以覆寫 LINQ to SQLLINQ to SQL 預設方法,以執行 InsertUpdateDelete 資料庫作業。You can override LINQ to SQLLINQ to SQL default methods for Insert, Update, and Delete database operations. 如需詳細資訊,請參閱自訂插入、更新和刪除作業For more information, see Customizing Insert, Update, and Delete Operations.

使用 Visual Studio 的開發人員可以使用物件關聯式設計工具,針對相同的目的來開發預存程式。Developers using Visual Studio can use the Object Relational Designer to develop stored procedures for the same purpose.

本節內容In This Section

如何:將資料列插入資料庫 How to: Insert Rows Into the Database
描述如何將物件加入至物件模型,以在資料庫中插入資料列。Describes how to insert rows in the database by adding objects to the object model.

如何:更新資料庫中的資料列 How to: Update Rows in the Database
描述如何更新物件模型中的物件,以更新資料庫中的資料列。Describes how to update rows in the database by updating objects in the object model.

如何:從資料庫刪除資料列 How to: Delete Rows From the Database
描述如何刪除物件模型中的物件,以刪除資料庫中的資料列。Describes how to delete rows in the database by deleting objects in the object model.

如何:將變更提交至資料庫 How to: Submit Changes to the Database
描述如何將物件模型變更傳送至資料庫。Describes how to send object-model changes to the database.

如何:使用交易來括住資料提交 How to: Bracket Data Submissions by Using Transactions
描述如何在異動中包括作業。Describes how to include operations in a transaction.

如何:動態建立資料庫 How to: Dynamically Create a Database
描述如何動態產生資料庫,以及這種方法的一般案例。Describes how to generate databases dynamically, and typical scenarios for this approach.

如何:管理變更衝突 How to: Manage Change Conflicts
描述解決開放式並行存取 (Optimistic Concurrency) 問題的技術。Describes techniques for addressing optimistic concurrency issues.