Jarod - the FillDataSet was the method I was speaking of. In practice, I
actually augmented it to have a FillTypedDataSet method and the only
difference is essentially that I have another parameter for the
tablemappings/columnmappings.
Also, although this isn't exactly what you asked origianlly, just as an FYI,
you can use a TypedDataset in the place of where you're expecting an
Untyped one - just not the other way around:
private void button1_Click(object sender, System.EventArgs e) {
DataSet dss = FillDataSet();
MessageBox.Show(dss.Tables.Count.ToString());
}
private Dataset1 FillDataSet(){
Dataset1 ds = new Dataset1();
DataTable dt = new DataTable();
DataColumn dc = new DataColumn("TestColumn", typeof(System.String));
dt.Columns.Add(dc);
ds.Tables.Add(dt);
DataRow dro = dt.NewRow();
dro[0] = "Bill Ryan";
dt.Rows.Add(dro);
return ds;
}
But ultimatey my point is that in this instance, you can easily add an
augmented method to your SqlHelper class as we did, FillTypedDataSet and
since it's a reference type, when you pass it in, any changes made to it
will be made to the origianl (I know, many purists say that you should use
return values instead but I honestly don't see anything wrong with this
approach).
On a scale of 1-10, it's about a 3 to add this in, and you can reuse it
everywhere (Typed Dataset have many many things to like about them, and not
having to worry about getting the colum names right is one of the bigger
ones) so it's a great component to build that you can use all over the
place. I'll be glad to walk you through it.
Cheers,
Bill