Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what's the Difference between DataView and DataTable?

Answers were Sorted based on User's Feedback



what's the Difference between DataView and DataTable?..

Answer / guest

data tables holds all the rows of the table where as date
view hold te filtered or reqired rows that are been retrived
on a particular condition

i think my answer is correct

Is This Answer Correct ?    95 Yes 23 No

what's the Difference between DataView and DataTable?..

Answer / ahmed yassin

DataView Object provides a window into a DataTable that can
be sorted and filtered using the Sort,RowFilter, and
RowStateFilter properties.It also contains the AllowDelete,
AllowEdit,AllowEdit, and AllowNew properties to constrain
user input as needed.

DataTable can have many DataView objects assigned to it,
allowing the data tobe viewed in many diffirent ways
without requiring the data to be reread from the database.

Example:::

DataTable customer = GetDataTable() //ur datable method
// add new datarow by adding the values
customer.Rows.Add("73OOFUFU","Mohamed","Ilyas",2533.00m);
customer.Rows.Add("3636366H","Idriis","Yassin",25545.00m);
//Sort and display
DataView view = new DataView(customer);
view.sort = "LastName ASC, FirstName ASC, Salary DESC";
GridView gv = new GridView();
gv.EnableViewState = false;
form1.Controls.Add(gv);
// assing ur gridview to dataview
gv.DataSource = veiw;
gv.DataBind();
*********************************
Sorry if there is some misspelt.

Is This Answer Correct ?    48 Yes 7 No

what's the Difference between DataView and DataTable?..

Answer / kuldeep paliwal

the dataview class that enable you to create various views
of the data stored in the data table.dataview is use to
filter the data in datatale.it can also be use to
add,modify and delete the row in datatable.datatable is
object contain one or more column each repersent by a
datacolumn object.

Is This Answer Correct ?    25 Yes 10 No

what's the Difference between DataView and DataTable?..

Answer / rajesh kumar chekuri

DataTable: Represents one table in-memory
DataView:: Represents a customized view of a DataTable for
sorting, filtering, searching, editing, and navigation.
See the following example u can get Better idea...

// Create a new DataTable.
System.Data.DataTable table = new
DataTable("Customers");
// Declare variables for DataColumn and DataRow objects.
DataColumn column;
DataRow row;

// Create new DataColumn, set DataType,
// ColumnName and add to DataTable.
column = new DataColumn();
column.DataType = System.Type.GetType("System.String");
column.ColumnName = "ID";
column.ReadOnly = true;
column.Unique = true;
// Add the Column to the DataColumnCollection.
table.Columns.Add(column);


// Create second column.
// Add the column to the table.
table.Columns.Add("FirstName",
System.Type.GetType("System.String"));

// Add the column to the table.
table.Columns.Add("LastName",
System.Type.GetType("System.String"));

// Make the ID column the primary key column.
DataColumn[] PrimaryKeyColumns = new DataColumn[1];
PrimaryKeyColumns[0] = table.Columns["id"];
table.PrimaryKey = PrimaryKeyColumns;


// add new datarow by adding the values
table.Rows.Add("C101", "Rajesh", "Kumar");
table.Rows.Add("C102", "Fareed", "sk");
table.Rows.Add("C103", "Rajesh", "Raji");

//Sort and display
DataView view = new DataView(table);
view.Sort = "LastName ASC, FirstName ASC";

// assing ur gridview to dataview
GridView1.DataSource = view;
GridView1.DataBind();

Is This Answer Correct ?    18 Yes 9 No

what's the Difference between DataView and DataTable?..

Answer / ajay

DataTable: Represents one table in-memory
select distinct field from the filtered dataview

Is This Answer Correct ?    9 Yes 4 No

what's the Difference between DataView and DataTable?..

Answer / surya pratap singh

The dataview class that enable you to create various views
of the data stored in the data table.dataview is use to
filter the data in datatale.it can also be use to
add,modify and delete the row in datatable.datatable is
object contain one or more column each repersent by a
datacolumn object.

Is This Answer Correct ?    4 Yes 2 No

what's the Difference between DataView and DataTable?..

Answer / zana

From you'll answers, i have a question: If i selected a row
from a datagrid bound to a dataview, how would i determine
which row in the datatable corresponded to the row i
selected? Let say i just needed to know which row in the
datatable my selection corresponded to.

Is This Answer Correct ?    10 Yes 12 No

what's the Difference between DataView and DataTable?..

Answer / satish

Data Table are also the filter rows of dataset(Virtual
table of database) whereas the dataview is only the
filtered view of the original database.

Is This Answer Correct ?    24 Yes 34 No

what's the Difference between DataView and DataTable?..

Answer / kamalakannan

1. Filter and sort the datatable or dataset.

2. select distinct field from the filtered dataview.

3. Datatable select function gives datarow array, but
dataview gives the datatable. The function easy to return
the dataview.

4. code will be reduced compare than datatable select
function.

Kamal..

Is This Answer Correct ?    8 Yes 27 No

what's the Difference between DataView and DataTable?..

Answer / aman kulkarni

Data Table is very very good and is useful.Dataset is very
bad and nonsense

Is This Answer Correct ?    20 Yes 80 No

Post New Answer

More C Sharp Interview Questions

What are the security issues if we send a query from the application?

1 Answers   Microsoft,


Hoe can i connect the table into the c# application?

2 Answers  


What is lazy loading entity framework?

0 Answers  


What is the difference between TypeOf, GetType and what are the uses of TypeOf, GetType.

2 Answers   Siemens, Syntel,


Is c# substring zero based?

0 Answers  


Compare and contrast between the System.Array.CopyTo() and Clone()?

0 Answers   Siebel,


Is int reference type c#?

0 Answers  


What is difference between write and writeline?

0 Answers  


Can we extend sealed class in c#?

0 Answers  


What issues can be faced while delivering code?

0 Answers   TCS,


What is sqlcommand in c#?

0 Answers  


how to return morethan one value using out parameter in c#.net ; For Example : public int show(out int []a) { int []a={1,2,3,4,5}; return a[]; } we have to print all the values without using the Console.WriteLine statement;

1 Answers   Verizon,


Categories