what is faster???

  • Thread starter Thread starter Fabio
  • Start date Start date
F

Fabio

What is faster to use in a DataGrid???

DataView, Dataset or DataTable


Thanks in advance,
Fabio Augusto
 
Ummm...

DataTable is a child of dataset

Dataview is a interpretation of Dataview... i do'nt know if anyone is
particularly faster since they are all based of a "dataset"
 
Fabio,
In addition to CJ's comments.

The DataGrid only binds to the DataView (to display values), so I would
think it will be the fastest.

Remember you do not bind to a DataSet you bind to a member of the DataSet,
this member is a DataTable.

Also remember if you set the DataSource property of a DataGrid to just a
DataSet, without setting the DataMember property, you are presented a list
of DataTables (in a tree like control) to select which DataTable to display
the values of.

Further when you bind to a DataTable the DataGrid uses the
DataTable.DefaultView property to get a DataView which the DataGrid actually
uses to retrieve & maintain data.

Hence, you only bind to a DataView, so its the fastest.

This and a number of other exciting ADO.NET topics is covered at length in
David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press.

Hope this helps
Jay
 
And to add to Jay's comments. =)
Jay B. Harlow said:
Fabio,
In addition to CJ's comments.

The DataGrid only binds to the DataView (to display values), so I would
think it will be the fastest.

Remember you do not bind to a DataSet you bind to a member of the DataSet,
this member is a DataTable.

Did some research on this, actually, it binds to the DefaultView object in a
DataTable... which is an object of type System.Data.DataView... =) So no
matter what, you use a Dataview.

However, using your own dataview lets you customize the view obviously. =)
Fun little fact that I didn't know.

I alos have Sceppa's book sitting right next to me. Great reference ( and
this dude knows ADO, you can talk to him on the adonet newsgroup if you have
real advanced questions too).

-CJ
 
CJ,
Did some research on this, actually, it binds to the DefaultView object in a
DataTable... which is an object of type System.Data.DataView... =) So no
matter what, you use a Dataview.
I did go on to state that ;-)

But its good to reiterate it sometimes!

Jay
 
Fabio,
Like all time dependable questions, it depends how you implement them.
Normaly I think a standalone datatabel in "read only mode from the datagrid"
will be the fastest.
Just a thought.
Cor
 
Back
Top