Saturday, August 2, 2008

1.How to update the data in dataset

A.The dataset can be considered as an in-memory cache of the data retrieved from the database.So the dataset consites of the tables, relationship and constraints.

To insert, update or delete the data in the database we use the sqlcommand

2.Why we need both server controls and html controls in asp.net. what is the difference between them?

A.HTML Server Controls:

This controls will follow similar syntax of html client side controls with the same set of properties (with runat="server" attribute). The purpose of this HTML Server controls is towards migration projects. And this HTML Server Controls doesn't support extensibility.

Web Server Controls:

These are very advanced controls if compared to HTML Controls. These controls overcome the extensibility problem which araises in HTML Server Controls. These controls are also called as Smart Controls, because these controls will produce HTML context based on reuested browser.

These Controls also supports data binding and xml based syntax with .net object model.

3.Whats the diffrence between Custom Control and a User Control?

A.If none of the existing ASP.NET server controls meet the specific requirements of your applications, you can create either a Web user control or a Web custom control that encapsulates the functionality you need. The main difference between the two controls lies in ease of creation vs. ease of use at design time.

Web user controls are easy to make, but they can be less convenient to use in advanced scenarios. You develop Web user controls almost exactly the same way that you develop Web Forms pages. Like Web Forms, user controls can be created in the visual designer, they can be written with code separated from the HTML, and they can handle execution events. However, because Web user controls are compiled dynamically at run time they cannot be added to the Toolbox, and they are represented by a simple placeholder glyph when added to a page. This makes Web user controls harder to use if you are accustomed to full Visual Studio .NET design-time support, including the Properties window and Design view previews. Also, the only way to share the user control between applications is to put a separate copy in each application, which takes more maintenance if you make changes to the control.

Web custom controls are compiled code, which makes them easier to use but more difficult to create; Web custom controls must be authored in code. Once you have created the control, however, you can add it to the Toolbox and display it in a visual designer with full Properties window support and all the other design-time features of ASP.NET server controls. In addition, you can install a single copy of the Web custom control in the global assembly cache and share it between applications, which makes maintenance easier