3 Replies - 1808 Views - Last Post: 21 March 2013 - 06:27 AM Rate Topic: -----

#1 shahar.algotec  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 14-March 13

How To : FAST coversion of DataSet to Strongly typed DataSet

Posted 20 March 2013 - 09:37 AM

Hi All,

I am sure many of you encouter the need to convert an untyped DataSet to a strongly typed DataSet.
The way I do it today is create a new Typed DataSet and use .merge() to populate the new DataSet with the data from the untyped DataSet.
The issue is that for large DataSets this procedure is very resource consuming and takes very long.

In most cases, the data in the untyped DataSet is valid for the Typed DataSet and it should be possible to set the internal data of the strongly typed DataSet to that of the untyped DataSet and avoid the costy merge.

Do you encouter the same issues?
Is there a good solution?

Thanks!
Shahar

Is This A Good Question/Topic? 0
  • +

Replies To: How To : FAST coversion of DataSet to Strongly typed DataSet

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,463
  • Joined: 05-May 12

Re: How To : FAST coversion of DataSet to Strongly typed DataSet

Posted 20 March 2013 - 06:58 PM

Have you considered doing a lazy conversion? Just convert data on demand, or in a paged manner?
Was This Post Helpful? 0
  • +
  • -

#3 shahar.algotec  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 14-March 13

Re: How To : FAST coversion of DataSet to Strongly typed DataSet

Posted 21 March 2013 - 05:31 AM

View PostSkydiver, on 20 March 2013 - 06:58 PM, said:

Have you considered doing a lazy conversion? Just convert data on demand, or in a paged manner?

Thanks for your reply.
For some specific scenarios a lazy conversion is indeed a good work-around, but often the entire DataSet is required, and the lazy conversion only delays the problem.
I am really looking for an immediate copy of the references to the data from untyped to the strongly typed DataSet.
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3662
  • View blog
  • Posts: 11,463
  • Joined: 05-May 12

Re: How To : FAST coversion of DataSet to Strongly typed DataSet

Posted 21 March 2013 - 06:27 AM

Does the Load() method provide a faster experience for you? You may need to write some code to create an IDataAdapter for your untyped source DataSet, but as I recall Load() just copies data directly, unlike Merge() which does look ups to find matching rows before importing a new row.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1