a direct convert function and I'm pretty sure you'd have to write your own
dataset to accomplish this implementing IConvertible for instance. I've
seen a lot of people do stuff like pass in a regular dataset to SqlHelper,
then loop through it copying the rows and then putting them in the typed
dataset (there's so much wrong with approaches like this it's hard to know
where to begin). It's a LOT easier to just fill the typed dataset from the
get go. DataSets are often pretty big too and consume a good bit of memory,
so creating one, just so you can convert it to another type and then destroy
it is definitely not an approach that will scale well,
As an aside, check this out:
private void button1_Click(object sender, System.EventArgs e) {
Dataset1 dss = new Dataset1();
FillDataSet(dss);
}
private void FillDataSet(DataSet ds){
MessageBox.Show(ds.Tables.Count.ToString());
}