When to use what...???

Hi, I'm using VB 2005, WinForms. I have a general quesiton regarding data-sources.

VB.NET offers different options in terms of data-sources such as DataSets, DataTables, DataViews, etc. When should each be used? In other words, why use a DataTable vs. a DataSet, or a DataView vs. a DataTable?

Also, is any one data-source more "flexible" or advantageous in any way in terms of use vs. any of the others?

Thanks for your guidance...
Fulano
Mr_FulanoAsked:
Who is Participating?
 
rionrocConnect With a Mentor Commented:
Hello


Use DataTable instead of DataSet.

DataTable uses less memory than DataSet.
DataTable is faster than DataSet.
DataTable is simple than using DataSet.
Use DataSet if you have a huge collection of tables.


eq.
Dim da As xSqlDataAdapter
Dim dt As New DataTable
da = New xSqlDataAdapter("select * from xtable", xsqlconn)
da.Fill(dt)


Great is our GOD.
:)
0
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
short explanation:
datatable just has 1 table, while dataset can have many
dataview allow you to have a filter that you can change on the fly.
0
 
Jorge PaulinoConnect With a Mentor IT Pro/DeveloperCommented:
When to use what...???
 If you read information from a database, you can store that on a dataset and then use it. You can then use a dataview to filter information.
You can use also datatables but has only one table but, in the other side, is very flexible to work with xml.
It depends of what you need!  
 
0
 
Mr_FulanoAuthor Commented:
Thank you for all your contributions. I think you all offered very good opinions and advice. Thanks for your help and I think a 3 way split is equitable.

Fulano
0
All Courses

From novice to tech pro — start learning today.