welcome folks
FAQ in android,FAQ in dotnet,DotNet, C#,DOT NET CODE, ASP.NET, VB.NET, TRICKS,Dotnetcode,Android and Latest Technology Articles in VB,Android and ASP.NET

Wednesday, August 22, 2012

what is Dataset in ADO.Net?

DataSet has a collection of DataTable objects within the Tables collection. Each DataTable object contains a collection of DataRow objects and a collection of DataColumn objects. There are also collections for primary keys, constraints, and default values used in this table, which is called as constraint collection, and the parent and child relationships between the tables. Finally, there is a DefaultView object for each table. This is used to create aDataView object based on the table, so that the data can be searched, filtered, or otherwise manipulated while displaying the data.

What is the use of a data adapter in ADO.NET?


These are the most commonly used methods of a DataAdapter:
  • Fill
  • Executes the Select command to fill the DataSet object with data from the data source. It an also be used to update (refresh) an existing table in a DataSet with changes made to the data in the original data source if there is a primary key in the table in the DataSet.
  • FillSchema
  • Uses the SelectCommand to extract just the schema for a table from the data source, and creates an empty table in the DataSet object with all the corresponding constraints.
  • Update
  • Calls the respective InsertCommandUpdateCommand, or DeleteCommand for each inserted, updated, or deleted row in the DataSet so as to update the original data source with the changes made to the content of the DataSet. This is a little like the UpdateBatch method provided by the ADO Recordset object, but in theDataSet, it can be used to update more than one table.

What is the use of Command objects in ADO.Net?


  • ExecuteNonQuery
  • Executes the command defined in the CommandText property against the connection defined in theConnection property for a query that does not return any row (an UPDATE, DELETE, or INSERT). Returns an Integer indicating the number of rows affected by the query.
  • ExecuteReader
  • Executes the command defined in the CommandText property against the connection defined in theConnection property. Returns a "reader" object that is connected to the resulting row set within the database, allowing the rows to be retrieved.
  • ExecuteScalar
  • Executes the command defined in the CommandText property against the connection defined in theConnection property. Returns only a single value (effectively the first column of the first row of the resulting row set, any other returned columns and rows are discarded). It is fast and efficient when only a "singleton" value is required.

What are the major difference between classic ADO and ADO.NET?


  • In ADO, we have a Recordset and in ADO.NET we have a DataSet.
  • In Recordset, we can only have one table. If we want to accommodate more than one table, we need to do inner join and fill the Recordset. A DataSet can have multiple tables.
  • All data is persisted in XML as compared to classic ADO where data is persisted in binary format.

What is the difference between DataSet and DataReader?


  • DataReader provides forward-only and read-only access to data, while the DataSet object can hold more than one table (in other words, more than one row set) from the same data source as well as the relationships between them.
  • DataSet is a disconnected architecture while DataReader is a connected architecture.
  • DataSet can persist contents while DataReader cannot persist contents, they are forward only.

what is the namesapce in .NET for data management


System.Data

This contains the basic objects used for accessing and storing relational data, such as DataSetDataTable, andDataRelation. Each of these is independent of the type of data source and the way we connect to it.

System.Data.OleDB

It contains the objects that we use to connect to a data source via an OLE-DB provider, such asOleDbConnectionOleDbCommand, etc. These objects inherit from the common base classes, and so have the same properties, methods, and events as the SqlClient equivalents.

System.Data.SqlClient

This contains the objects that we use to connect to a data source via the Tabular Data Stream (TDS) interface of Microsoft SQL Server (only). This can generally provide better performance as it removes some of the intermediate layers required by an OLE-DB connection.

System.XML

This contains the basic objects required to create, read, store, write, and manipulate XML documents according to W3C recommendations.

Wednesday, August 15, 2012

What are the differences between Web Sites and Web Applications?


Default website project model uses the directory structure to define the contents of the project.
 In this model, there is no project file and all files in the directory are part of the project.
Also you can directly edit and run the content of the project without doing any compile.

Web application project, the files that are explicitly referenced in the solution's project file are the only ones that are part of the project. These files are displayed in Solution Explorer and they are the only files that are compiled during a build.
Edited files are created files can run only after compile.