ADO.NET 2.0 TableAdapter and diffgrams

I've taken a look at the new TableAdapter in ADO.NET 2.0. I'm wondering how do you use Diffgrams (via dataset.GetChanges()) together with TableAdapters. They seems to be handy unless it comes to Diffgram based update scenarios.

My scenarios: I get an Diffgram of Dataset which contains a number of tables. I would like to update the tables using DataAdapters with this Diffgram. The problem is that the DataAdapter doesn't accept untyped datasets as been produced by dataset.GetChanges(). Is this not a supported scenario (do I need to use DataAdaptors?) or do I miss something. Any help is appreciated.

[1038 byte] By [MichaelZill] at [2008-1-28]
# 1

Michael,

While the GetChanges signature says it returns an un-typed DataSet/DataTable, it's actually strongly typed.

The simplest solution is to cast the return value to a strongly-typed DataSet or DataTable for the call to Update.

I hope this information proves helpful.

David Sceppa
Microsoft

DavidSceppa at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified