TypedDataSet practices

  • Thread starter Thread starter Ian Semmel
  • Start date Start date
I

Ian Semmel

If you have a typed dataset, there is a DataTable defined for each table.

We can Fill these tables and Update them etc.

If we use the GetData() function, we get a new DataTable with the results of the
action.

Now, what I am asking is : what is the best thing (or accepted practice) to do ?
Reuse the DataTable in the DataSet, or get a new table each time ?
 
Ian,

I don't see why you can't use the new table every time. It might cost
you some cycles (since you will have to remove the old typed data table from
the data set, and then add the new one).

I do believe that if you use Fill, it will fill the current table in the
data set, and clear it out, which would seem to be more efficient, IMO.

Hope this helps.
 
I dunno, thinking about it and depending on the size of the dataset, a clear
might be more performant.
I only base this on the fact that in the debugger strongly typed datasets
can take ages to initialize (especially ones with 15+ tables).
Has anyone ever done any benchmarks on this?

Nicholas Paldino said:
Ian,

I don't see why you can't use the new table every time. It might cost
you some cycles (since you will have to remove the old typed data table from
the data set, and then add the new one).

I do believe that if you use Fill, it will fill the current table in the
data set, and clear it out, which would seem to be more efficient, IMO.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Ian Semmel said:
If you have a typed dataset, there is a DataTable defined for each table.

We can Fill these tables and Update them etc.

If we use the GetData() function, we get a new DataTable with the results
of the action.

Now, what I am asking is : what is the best thing (or accepted practice)
to do ? Reuse the DataTable in the DataSet, or get a new table each time
?
 
Back
Top