计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句

上传人:桔**** 文档编号:460760053 上传时间:2022-09-05 格式:DOC 页数:7 大小:69KB
返回 下载 相关 举报
计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句_第1页
第1页 / 共7页
计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句_第2页
第2页 / 共7页
计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句_第3页
第3页 / 共7页
计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句_第4页
第4页 / 共7页
计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句_第5页
第5页 / 共7页
点击查看更多>>
资源描述

《计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句》由会员分享,可在线阅读,更多相关《计算机-外文翻译-外文文献-英文文献-统一建模语言-Visual-Studio-.NET如何为并发控制生成SQL语句(7页珍藏版)》请在金锄头文库上搜索。

1、本科科设计(论文)外文翻译原文:How Visual Studio .NET Generates SQL Statements for Concurrency ControlAuthor: Steve SteinVisual Studio TeamAbstract: This paper examines the SQL statements Visual Studio .NET generates for different kinds of concurrency control, how to modify them for better performance, and how to

2、generate a statement that does not use concurrency control. (5 printed pages).IntroductionAny application that might have multiple users simultaneously attempting to access and modify data needs some form of concurrency control. Otherwise, one users changes could inadvertently overwrite modification

3、s from other users. The design tools in Visual Studio .NET can create SQL statements that use the check all values approach to optimistic concurrency or the last-in wins approach to updating data. This paper will explain: How each of these statement types are generated. How to modify the generated S

4、QL statement for better performance. PrerequisitesYou should have an understanding of: Fundamental ADO.NET data concepts, including datasets and data adapters. For more information, see Introduction to Data Access with ADO.NET. Concurrency control basics and the options available in Visual Studio .N

5、ET. For more information, see Introduction to Data Concurrency in ADO.NET. Where Are the SQL Statements?SQL statements are located in the CommandText property of command objects. SQL commands are automatically generated at design time when configuring data adapters, and at run time when using comman

6、d builder objects. For more information, see Concurrency and Command Builder Objets .before us have addressed overlay network programming issues. Even early overlay network Configuring Data Adapters Drag a data adapter from the Data tab of the Toolbox Drag a table from Server Explorer Modifying an e

7、xisting adapter, by selecting a data adapter and clicking the Configure Data Adapter link at the bottom of the Properties window. Command Builder objects Command builder objects are created programmatically at run time. For more information, see (SqlCommandBuilder or OleDbCommandBuilder) Concurrency

8、 and Data AdaptersWhen configuring data adapters with the Data Adapter Configuration Wizard, you can decide whether to use optimistic concurrency for the generated Update and Delete statements.Considerations and Caveats Your data source must have a primary key in order for the SQL statements to be g

9、enerated to use optimistic concurrency. When creating data adapters by dragging tables from Server Explorer, the data adapter creates Update and Delete statements that are automatically configured for optimistic concurrency. If you do not want to use optimistic concurrency, you can reconfigure the d

10、ata adapter: Right-click the adapter and select Configure Data Adapter from the shortcut menu, then clear the Use optimistic concurrency option of the Advanced SQL Generation Options Dialog Box. The wizard will recreate the statements without the additional code to check for concurrency violations.

11、When reconfiguring an existing data adapter, note that the advanced settings all revert to their default state. For example, if you cleared the Use optimistic concurrency option when the adapter was originally configured, it will automatically be selected if you reconfigure it, even if you do not ac

12、cess the Advanced SQL Generation Options dialog box. If you select the Use existing stored procedures option in the Choose a Query Type section of the Data Adapter Configuration Wizard, the option to use optimistic concurrency is not available. The stored procedures will execute as is, and any desir

13、ed concurrency checking must be done within the stored procedure, or programmatically built into your application.。When commands are generated to use optimistic concurrency, no verification will be performed on binary columns to determine whether concurrent changes have been made. The resources to p

14、erform a bit-by-bit comparison of a large binary record would be extremely inefficient.can be used as a key to SQL Statements Generated by the WizardTo understand how Visual Studio .NET constructs SQL statements that use optimistic concurrency, let us inspect the Update statement generated by the Da

15、ta Adapter Configuration Wizard. We will look at the same statement generated both with and without the Use optimistic concurrency option selected in the Advanced SQL Generation Options dialog box of the wizard.You will notice the differences between statements that either use optimistic concurrency

16、 or not are located in the Where clause.NoteThe following examples use the Update command that is generated by running the Data Adapter Configuration Wizard, and selecting several columns from the Customers table in the Northwind sample database.Update Statement Using Optimistic ConcurrencyThis example uses the default settings of the Data Adapter Configuration Wizard, which has the Use optimistic concu

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号