Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Professional ASP.NET 3.5 in C# and Visual Basic Part 35. Building on the revolutionary ASP.NET 2.0 release, ASP.NET 3.5 adds several key new developer features including AJAX, LINQ, and a new CSS designer in Visual Web Developer 2008. The dramatic reduction in code that developers realized from the more than 50 new server controls in ASP.NET 2.0 now allows developers the time to make their applications more interactive with AJAX, to work with data in their preferred language with LINQ, and to build visually attractive and consistent standards-based sites with CSS. . | Chapter 7 Data Binding in ASP.NET 3.5 SelectParameters asp QueryStringParameter Name CustomerID QueryStringField ID Type String asp QueryStringParameter SelectParameters asp SqlDataSource In addition to hand-coding your SelectParameters collection you can create parameters using the Command and Parameter Editor dialog which can be accessed by modifying the SelectQuery property of the SqlDataSource control while you are viewing the Web page in design mode. Figure 7-5 shows the Command and Parameter Editor dialog. Figure 7-5 This dialog gives you a fast and friendly way to create SelectParameters for your query. Simply select the Parameter source from the drop-down list and enter the required parameter data. Figure 7-5 295 Chapter 7 Data Binding in ASP.NET 3.5 demonstrates how to add the QuerystringParameter based on the value of the querystring Field ID to your SqlDataSource control. Conflict Detection Property The ConflictDetection property allows you to tell the SqlDataSource control what style of conflict detection to use when updating the data. This determines what action should be taken if more than one user attempt to modify the same data. When the value is set to OverwriteChanges the control uses a Last in Wins style of updating data. In this style the control overwrites any changes to data that have been made between the time the data was retrieved by the control and the time the update is made. If the value is set to CompareAllValues the data source control compares the original data values what was retrieved to the data values currently in the data store. If the data has not changed since it was retrieved the control allows the changes to be implemented. If the control detects differences between the original data that was retrieved from the data store and what is currently in the data store it does not allow the update to continue. This could potentially occur when you have multiple users accessing the data store and making changes to the data at the same