Saturday 10 December 2011

Imp qus in asp .net


What method do you use to explicitly kill a users session ? 

Abandon()

What is cookie less session? How it works ? 

By default, ASP.NET will store the session state in the same process that processes the request, just as ASP does. If cookies are not available, a session can be tracked by adding a session identifier to the URL. This can be enabled by setting the following:
http://samples.gotdotnet.com/quickstart/aspplus/doc/stateoverview.aspx

Difference between ASP Session and ASP.NET Session ? 

asp.net session supports cookie less session & it can span across multiple servers

How many classes can a single .NET DLL contain ? 

It can contain many classes.

true or False: To test a Web service you must create a windows application or Web application to consume this service ? 

False, the webservice comes with a test page and it provides HTTP-GET method to test

Which control would you use if you needed to make sure the values in two different controls matched ? 

CompareValidator Control

Which property on a Combo Box do you set with a column name, prior to setting the DataSource, to display data in the combo box ? 

DataTextField property

What does WSDL stand for ? 

 (Web Services Description Language)

True or False: A Web service can only be written in .NET ? 

False

What tags do you need to add within the asp:datagrid tags to bind columns manually ? 

Set AutoGenerateColumns Property to false on the datagrid tag

What base class do all Web Forms inherit from ? 

The Page class.

What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control ? 

You must set the DataSource property and call the DataBind method.

Which template must you provide, in order to display data in a Repeater control ? 

ItemTemplate

If I’m developing an application that must accommodate multiple security levels though secure login and my ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users ? 

Maintain the login state security through a database.

What does the “EnableViewState” property do? Why would I want it on or off ? 

It enables the viewstate on the page. It allows the page to save the users input on a form.

What data type does the RangeValidator control support ? 

Integer,String and Date.

Suppose you want a certain ASP.NET function executed on MouseOver overa certain button. Where do you add an event handler ? 

It’s the Attributesproperty, the Add function inside that property. So btnSubmit.Attributes.Add(”onMouseOver”,”someClientCode();”)

What’s a bubbled event ? 

When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

What’s the difference between Codebehind=”MyCode.aspx.cs” andSrc=”MyCode.aspx.cs” ? 

CodeBehind is relevant to Visual Studio.NET only.

Where do you store the information about the user’s locale ? 

System.Web.UI.Page.Culture

Where does the Web page belong in the .NET Framework class hierarchy ? 

System.Web.UI.Page

What’s the difference between Response.Write() andResponse.Output.Write() ? 

The latter one allows you to write formattedoutput.

Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process ? 

inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension),the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.
getXML () and get Schema ()

Differences between dataset.clone and dataset.copy ? 

Clone - Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data.
Copy - Copies both the structure and data for this DataSet.

How to check if a datareader is closed or opened ? 

IsClosed()

n how many ways we can retrieve table records count? How to find the count of records in a dataset ? 

foreach(DataTable thisTable in myDataSet.Tables){
// For each row, print the values of each column.
foreach(DataRow myRow in thisTable.Rows){

What happens when we issue Dataset.ReadXml command ? 

Reads XML schema and data into the DataSet.

Explain different methods and Properties of DataReader which you have used in your project ? 

Read
GetString
GetInt32
while (myReader.Read())
Console.WriteLine(”\t{0}\t{1}”, myReader.GetInt32(0), myReader.GetString(1));
myReader.Close();

Difference between DataReader and DataAdapter / DataSet and DataAdapter? 

You can use the ADO.NET DataReader to retrieve a read-only, forward-only stream of data from a database. Using the DataReader can increase application performance and reduce system overhead because only one row at a time is ever in memory.
After creating an instance of the Command object, you create a DataReader by calling Command.ExecuteReader to retrieve rows from a data source, as shown in the following example.
SqlDataReader myReader = myCommand.ExecuteReader();
You use the Read method of the DataReader object to obtain a row from the results of the query.
while (myReader.Read())
Console.WriteLine(”\t{0}\t{1}”, myReader.GetInt32(0), myReader.GetString(1));
myReader.Close();
The DataSet is a memory-resident representation of data that provides a consistent relational programming model regardless of the data source. It can be used with multiple and differing data sources, used with XML data, or used to manage data local to the application. The DataSet represents a complete set of data including related tables, constraints, and relationships among the tables. The methods and objects in a DataSet are consistent with those in the relational database model. The DataSet can also persist and reload its contents as XML and its schema as XML Schema definition language (XSD) schema.
The DataAdapter serves as a bridge between a DataSet and a data source for retrieving and saving data. The DataAdapter provides this bridge by mapping Fill, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet. If you are connecting to a Microsoft SQL Server database, you can increase overall performance by using the SqlDataAdapter along with its associated SqlCommand and SqlConnection. For other OLE DB-supported databases, use the DataAdapter with its associated OleDbCommand and OleDbConnection objects.

No comments:

Post a Comment