Info

AttachDbFilename, The full or relative path and name of a file containing extended properties, initial the database to be attached to. The path supports the file name keyword string DataDirectory , which points to the application's data directory. The database must reside on a local drive. The log file name must be in the format < database-File-Name> _log.ldf or it will not be found. If the log file is not found, a new log file is created. Initial Catalog, database The name of the database...

Note Net 20

The TreeView is new in ASP.NET version 2.0. Abstract Class i BaseDataBoundControl S AutoGenerateDataBindings Wi Collapseimage ool ip H CollapseimageUrl W EnableClientScript H ExpandDepth W Expandimage ool ip H ExpandimageUrl H HoverNodeStyle imageSet H LeafNodeStyle LevelStyles H LineimageFolder H MaxDataBindDepth Nodeindent H NodeStyle NodeWrap H NoExpandimageUrl H ParentNodeStyle PathSeparator H PopulateNodesFromClient m RootNodeStyle H SelectedNodeStyle B SelectedValue ShowCheckBoxes H...

Storing and Retrieving Binary Large Object BLOB Data

When working with data, one challenge is to move large objects between the client application and the database server. In some scenarios, you might be able to treat large-object data just like any other data, but in many cases, you might be forced to look at alternative approaches. In ADO.NET you can work with BLOBs by using a SqlDataReader object to return a result set, by using a SqlDataAdapter object to fill a DataTable object, or by using a SqlParameter configured as an output parameter. If...

Lab Using Web Parts

In this lab, you create a Web page that uses Web Parts. You then expand the page capabilities to enable users to customize the page, and then add controls that communicate with each other. Exercise 1 Create a Web Page with Web Parts In this exercise, you create a Web page that uses Web Parts and enables the user to arrange and modify the Web Parts. 1. Create a new ASP.NET Web site named MyWebParts in either C or Visual Basic using Visual Studio 2005. 2. From the Toolbox, under WebParts, drag a...

The XML Document Object Model

The W3C has provided standards that define the structure and provide a standard programming interface that can be used in a wide variety of environments and applications for XML documents. This is called the Document Object Model (DOM). Classes that support the DOM are typically capable of random access navigation and modification of the XML document. The XML classes are accessible by setting a reference to the System.Xml.dll file and adding the Imports System.Xml (C using System.Xml )...

Lab Working With Site Navigation

In this lab, you create a Web application using frames. The top frame contains a title for your Web application and a SiteMapPath control. The left frame contains a Tree-View control for navigation. Clicking any node on the TreeView or SiteMapPath controls cause the main frame to load the desired page. Exercise 1 Create the Web Application Project and Its Frames In this exercise, you create the Web application project. You also configure Default.aspx to be a frames page and add the top and left...

Navigating Data Table Objects with Data Relation Objects

The DataRelation object is used to join two DataTable objects that are in the same DataSet, thus providing a navigable path between the two DataTable objects. The DataRelation can be traversed from parent DataTable to child DataTable or from child DataTable to parent DataTable. The following code example populates the Company and Employee DataTable objects and then performs DataRelation object navigation Protected Sub Button2_Click ByVal sender As Object, _ ByVal e As System.EventArgs Handles...

Open Wave

One of the common cell phone emulator providers is OpenWave you can download the latest phone emulators from http developer.openwave.com. Figure 12-1 shows the generic phone emulator. In addition, OpenWave also provides skins for many popular phones. Figure 12-1 The OpenWave generic phone emulator. When the generic phone is displayed, the Simulator Console window is also displayed, as shown in Figure 12-2. The Simulator Console window displays the raw Hypertext Transfer Protocol HTTP and header...

Configuring Deployment Properties

Many Web applications do not require custom configuration. More complex Web applications might have complex dependencies such as particular operating system versions or service packs , require custom registry entries, or need administrator configuration. You can use Web Setup Projects to deploy Web applications to meet any of these requirements. The sections that follow discuss how to do this in more detail. Configuring Launch Conditions You can specify launch conditions to restrict the...

Using the DbData Reader Object

A DbDataReader object provides a high-performance method of retrieving data from the data store. It delivers a forward-only, read-only, server-side cursor. This makes the DbDataReader object an ideal choice for populating ListBox controls, DropDownList controls, and even GridView controls that display read-only data. When you run reports, you can use the DbDataReader object to retrieve the data from the data store. The DbDataReader might not be a good choice when you are coding an operation...

Using the DbData Adapter Object

The DbDataAdapter object is used to retrieve and update data between a DataTable and a data store. The DbDataAdapter is derived from the DataAdapter class and is the base class of the provider-specific DbDataAdapter classes, as shown in Figure 4-14. Figure 4-14 The DbDataAdapter hierarchy, showing the DataAdapter base class and the provider-specific derived classes Figure 4-14 The DbDataAdapter hierarchy, showing the DataAdapter base class and the provider-specific derived classes The...

The Literal Control

The Literal control is similar to the Label control, as both controls are used to display static text on the Web page. The Literal control does not inherit from WebControl, as shown in the Literal control's object model in Figure 3-1. The Literal control does not provide substantial functionality and does not add any HTML elements to the Web page where the Label is rendered as a lt span gt tag. This means that the Literal does not have a Style property, and you cannot apply any styles,...

Creating a Templated User Control

A templated user control provides separation of control data from its presentation, meaning that a templated user control does not provide a default user interface. For example, if you know that you need to display your shipper's information, such as the shipper ID, the shipper name, and the shipper phone number, but you don't know how the page designer wants to format this information, you could create a templated user control called ShipperControl that allows the page designer to supply the...

Lesson Review

You can use the following questions to test your knowledge of the information in Lesson 1, Building Mobile Applications. The questions are also available on the companion CD if you prefer to review them in electronic form. Answers to these questions and explanations of why each answer choice is right or wrong are located in the Answers section at the end of the book. 1. You attempt to create a mobile Web site, but don't see a mobile Web site project template, so you create a standard Web site....

Dbq

Typically, the physical path to a data source. Working with Sample ODBC Connection Strings The following connection string instructs the text driver to treat the files that are located in the C Sample MySample-Folder subdirectory as tables in a database. Driver Microsoft Text Driver .txt .csv DBQ C Samp1e MySamp1eFo1der The following connection string instructs the Access driver to open the Northwind database file that is located in the C Program Files mySampleFolder folder. Driver Microsoft...

Sign Out Removes the authentication ticket essentially logging the user off Creating a Custom Forms Authentication Page

When using forms authentication, you must include two sections at a minimum A forms authentication page A method for users to log off and close their current sessions To create a forms authentication page, create an ASP.NET Web form to prompt the user for credentials and call members of the System.Web.Security.FormsAuthentication class to authenticate the user and redirect him or her to a protected page. The following code sample demonstrates an overly simple authentication mechanism that just...

Exercise 1 Create a Web Setup Project

In this exercise, you create a new ASP.NET Web site and a Web Setup Project. 1. In Visual Studio 2005, create a new Web site. 2. In Visual Studio, select the File menu, select Add, and then select New Project. 3. Under Project Types, expand Other Project Types, and then select Setup And Deployment. Under Templates, click Web Setup Project. In the Name field, type MyWebSetup. Then click OK. 4. Visual Studio adds the project to your Web site and displays the File System editor. Right-click Web...

The Image Control

The Image control is used to display an image on a Web page. This control generates an lt img gt element when rendering to HTML. The Image control inherits directly from the Web control class, and the ImageMap and ImageButton inherit from the Image control, as shown in Figure 3-5. Figure 3-5 The Image control hierarchy. Figure 3-5 The Image control hierarchy. The Image control's primary property, ImageUrl, indicates the path to the image that is downloaded from the browser and displayed. This...

Lab Store State Management Data on the Client

In this lab, you use different client-side state management techniques to track the number of pages a user opens. Exercise 1 Store Data in View State In this exercise, you add custom values to the ViewState object and then test the behavior when browsing to different pages. 1. Create a new ASP.NET Web site named ClientState in either C or Visual Basic using Visual Studio 2005. 2. In the blank project, on the Default.aspx page, add a label named Labell, a button named Buttonl, and a hyperlink...

Take a Practice Test

The practice tests on this book's companion CD offer many options. For example, you can test yourself on just the content covered in this chapter, or you can test yourself on all the 70-528 certification exam content. You can set up the test so that it closely simulates the experience of taking a certification exam, or you can set it up in study mode so that you can look at the correct answers and explanations after you answer each question. For details about all the practice test options...

Using the DbCommand Object

The DbCommand object is used to send one or more Structured Query Language SQL statements to the data store. The DbCommand can be any of the following types Data Manipulation Language DML Commands that retrieve, insert, update, or delete data. Data Definition Language DDL Commands that create tables or other database objects, or modify the database schema. Data Control Language DCL Commands that grant, deny, or revoke permissions. The DbCommand object requires a valid open connection to issue...

Programmatically Invalidating Cached Pages

Often, you want to cache pages, but specific events might require you to stop using the cached page. For example, a page that displays results from a database query should only be cached until the results of the database query change. Similarly, a page that processes a file should be cached until the file is changed. Fortunately, ASP.NET gives you several ways to invalidate cached pages. The sections that follow describe how to make caching choices before returning a page and how to create a...

Asynchronous Web Page Programming

Asynchronous programming allows a process to have multiple threads, enabling the process to do more than one action simultaneously. While asynchronous programming can be complicated, it can dramatically improve performance in situations where the process would otherwise need to wait for a relatively slow action, such as accessing a network resource, to occur. If you have done asynchronous programming in Windows Forms applications, you can also use those techniques in ASP.NET Web forms. However,...

The Hierarchical DataBound Control Control

The HierarchicalDataBoundControl control serves as a base class for controls that render data in a hierarchical fashion. The classes that inherit from HierarchicalDataBound-Control are TreeView and Menu, as shown in Figure 3-48. Figure 3-48 The HierarchicalDataBoundControl class hierarchy. Figure 3-48 The HierarchicalDataBoundControl class hierarchy.