Where I work we're finally coming around to the idea of using strongly typed datasets to encapsulate some of our queries to sqlserver. One of the idea's I've been touting is the strength of the strongly typed column's, mainly for not needing to cast any data. Am I wrong in thinking that strongly-typed-datasets would improve performance in the following situation where there could be potentially thousands of rows?
old way:
using(DataTable dt = sql.ExecuteSomeQuery())
{
foreach (DataRow dr in dt.Rows)
{
var something = (string)dr["something"];
var somethingelse = (int)dr["somethingelse"];
}
}
new way:
MyDataAdapter.Fill(MyDataset);
foreach (DataRow dr in MyDataset.MyDT.Rows)
{
var something = dr.Something;
var somethingelse = dr.SomethingElse;
}
If the properties are really just doing the casting behind the scenes, I can see how there wouldn't be any speedup at all; perhaps it would take even longer then before with the overhead of the function call in the first place.
Are there any other performance strengths / weaknesses of using DataSets we should know about?
Thanks!