Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

I have a typed Dataset, generated by VS Designer. Resently I've added a new column to one of the tables, and suddently in different DLLs where the dataset was used, I've started to get

Error 22 The type 'System.Data.TypedTableBase`1<T0>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

 

Apparently VS 2008 changed the base class for Typed DataTables 

3.5 : public partial class SubusersDataTable : global::System.Data.TypedTableBase<SubusersRow> {

2.0: public partial class SubusersDataTable : global::System.Data.DataTable, global::System.Collections.IEnumerable {

 and you need to change all dependant assemblies to

target 3.5 framework (if not done yet) and

add a reference to assembly 'System.Data.DataSetExtensions, Version=3.5.0.0 

 

More details about the change from http://blogs.msdn.com/vbteam/archive/2008/05/14/how-linq-to-dataset-works-in-vb-jonathan-aneja.aspx

Note that for strongly-typed Datasets you don’t need to call AsEnumerable, as they inherit from TypedTableBase(Of T) which implements IEnumerable.  This is a new type in VS2008; in VS2005 the Dataset Designer would generate code that inherited from DataTable and then explicitly implemented IEnumerable itself.

 

Posted on Sunday, May 10, 2009 9:50 AM .Net Framework , Code Generation | Back to top


Comments on this post: Typed DataTable's base class in VS008

# re: Typed DataTable's base class in VS008
Requesting Gravatar...
Just posted yesterday, what luck! Thanks Mike, I was able to fix our issue in 1 minute.
Left by Matt Williamson on May 12, 2009 5:12 AM

# re: Typed DataTable's base class in VS008
Requesting Gravatar...
Really helpful for me. Thanks.
Left by yashpal on Oct 04, 2011 2:18 PM

Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net