.NET Questions

Q:

Explain the concept of states in ASP.NET.

Answer

State is quite an innovative concept in Web development because it eliminates the drawback of losing state data due to reloading of a Web page. By using states in a Web application, you can preserve the state of the application either at the server or client end. The state of a Web application helps you to store the runtime changes that have been made to the Web application. For example, as already described earlier, a change in the data source of the Web application might be initiated by a user when he/she selects and saves some products in the shopping cart.

If you are not using states, these changes are discarded and are not saved. You may think that the whole concept of storing states is optional. However, under certain circumstances, using states with applications is imperative. For example, it is necessary to store states for Web applications, such as an e-commerce shopping site or an Intranet site of a company, to keep track of the requests of the users for the items they have selected on the shopping site or the days requested for vacation on the Intranet site.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1850
Q:

Explain why workflows are based on Extensible Models.

Answer

Workflows serve the purpose of automating business processes. Now, since each type of business has a wide range of problems; therefore, a workflow platform needs to be extensible. WF provides you with a set of base activities, such as IfElse, Code, and Delay, to build a workflow. You can extend these activities or build new activities to meet your requirements. Besides activities, you can also extend services, such as tracking, management, and persistence, provided by the runtime engine.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1833
Q:

Describe the situations in which AJAX should not be used.

Answer

You should not use AJAX if:



             =>  You want the page to show in a search engine, such as Google, because WebCrawler does not execute JavaScript code.

             =>  The browser does not support JavaScript.

             =>  You want to create a secure application.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1813
Q:

What are the usages of the Command object in ADO.NET?

Answer

The following are the usages of the Command object in AD0.NET:

The Command object in AD0.NET executes a command against the database and retrieves a DataReader or DataSet object.

  =>  It also executes the INSERT, UPDATE, or DELETE command against the database.
  =>  All the command objects are derived from the DbCommand class.
  =>  The command object is represented by two classes: SqlCommand and OleDbCommand.
  =>  The Command object provides three methods to execute commands on the database:
  =>  The ExecuteNonQuery() method executes the commands and does not return any value.
  =>  The ExecuteScalar() method returns a single value from a database query.
  =>  The ExecuteReader() method returns a result set by using the DataReader object.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1806
Q:

Does .NET support multiple inheritance?

Answer

.NET does not support multiple inheritance directly because in .NET, a class cannot inherit from more than one class. .NET supports multiple inheritance through interfaces.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1783
Q:

What are the usages of the Command object in ADO.NET?

Answer

The following are the usages of the Command object in AD0.NET:

The Command object in AD0.NET executes a command against the database and retrieves a DataReader or DataSet object.

  =>  It also executes the INSERT, UPDATE, or DELETE command against the database.
  =>  All the command objects are derived from the DbCommand class.
  =>  The command object is represented by two classes: SqlCommand and OleDbCommand.
  =>  The Command object provides three methods to execute commands on the database:
  =>  The ExecuteNonQuery() method executes the commands and does not return any value.
  =>  The ExecuteScalar() method returns a single value from a database query.
  =>  The ExecuteReader() method returns a result set by using the DataReader object.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1771
Q:

How can you prevent a class from overriding in C# and Visual Basic?

Answer

You can prevent a class from overriding in C# by using the sealed keyword; whereas, the NotInheritable keyword is used to prevent a class from overriding in Visual Basic.

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1770
Q:

How to create a Delegate?

Answer

public delegate void Del<T>(T item);


Del<int> d1 = new Del<int>(Notify);

Report Error

View answer Workspace Report Error Discuss

Subject: .NET

0 1763