What is a datatable?

Answer Posted / abhishek

A DataSet is made up of a collection of tables, relationships, and constraints. In ADO.NET, DataTable objects are used to represent the tables in a DataSet. A DataTable represents one table of in-memory relational data; the data is local to the .NET-based application in which it resides, but can be populated from a data source such as Microsoft SQL Server using a DataAdapter For more information, see Populating a DataSet from a DataAdapter (ADO.NET).

The DataTable class is a member of the System.Data namespace within the .NET Framework class library. You can create and use a DataTable independently or as a member of a DataSet, and DataTable objects can also be used in conjunction with other .NET Framework objects, including the DataView. You access the collection of tables in a DataSet through the Tables property of the DataSet object.

The schema, or structure of a table is represented by columns and constraints. You define the schema of a DataTable using DataColumn objects as well as ForeignKeyConstraint and UniqueConstraint objects. The columns in a table can map to columns in a data source, contain calculated values from expressions, automatically increment their values, or contain primary key values.

In addition to a schema, a DataTable must also have rows to contain and order data. The DataRow class represents the actual data contained in a table. You use the DataRow and its properties and methods to retrieve, evaluate, and manipulate the data in a table. As you access and change the data within a row, the DataRow object maintains both its current and original state.

You can create parent-child relationships between tables using one or more related columns in the tables. You create a relationship between DataTable objects using a DataRelation. DataRelation objects can then be used to return the related child or parent rows of a particular row.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you connect to sql server database without using sqlclient?

474


What is full form of ado?

530


What is dataset object? Explain the various objects in dataset.

584


What are the different ado.net namespaces are available in .net?

489


Explain the DataAdapter.Update() and DataSetAcceptChanges() methods.

514






What are the steps you will take to improve performance?

457


What two types of data providers does ADO.NET supply? What determines which one you should use?

531


What are disadvantages of microsoft-provided data provider classes in ado.net?

496


What is the difference between data grid and data repeater?

500


Which architecture does Datasets follow?

579


What is the DataTableCollection?

565


What is the meaning of executenonquery?

532


Does entity framework use ado.net?

494


Describe connection object in ado.net

534


What is data view and variable view?

476