Đ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 37. 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 SqlCacheDependency property to create SQL dependencies. You can learn more about ASP.NET caching features in Chapter 23. Storing Connection Information In ASP.NET 1.0 1.1 Microsoft introduced the web.config file as a way of storing application configuration data in a readable and portable format. Many people quickly decided that the web.config file was a great place to store things like the database connection information their applications use. It was easy to access from within the application created a single central location for the configuration data and it was a cinch to change just by editing the XML. Although all those advantages were great several drawbacks existed. First none of the information in the web.config file can be strongly typed. It was therefore difficult to find data type problems within the application until a runtime error occurred. It also meant that developers were unable to use the power of IntelliSense to facilitate development. A second problem was that although the web.config file was secured from access by browsers it cannot be served up by Internet Information Server the data within the file was clearly visible to anyone who had file access to the Web server. Microsoft has addressed these shortcomings of the web.config file by adding features specifically designed to make it easier to work with and secure connection string information in the web.config file. Because database connection information is so frequently stored in the web.config file starting with ASP.NET 2.0 a new configuration section was added in that file. The connectionStrings section is designed specifically for storing the connection string information. If you examine your web.config file you should see at least one connection string already in the connectionStrings section because our example told the Data Connection Wizard to store connections in the web.config file. Listing 7-19 shows how ASP.NET stores a connection string. .