.net - Extend DataSet Class Not Working -
i've created dataset using dataset designer. 1 of tables called users
, there class called usersdatatable
. in class properties, namely connection
. created partial class usersdatatable
, none of routines, properties, or variables usersdatatable
class in designer codebehind file visible me.
i'm trying extend class add own routines leverage connections , strong typing of designer-generated class. i've tried creating own partial classes , testing them see if have problem other classes , don't. these dataset designer-generated classes can not access items in other half of partial class.
i'm working in .net 4. might doing wrong?
all of "partial" classes must declared such in order technique work, , i'm guessing visual studio dataset designer isn't generating partial classes:
http://msdn.microsoft.com/en-us/library/wa80x488(v=vs.100).aspx
you might need inherit designer-generated classes instead.
edit: looked @ vs2010-generated dataset classes, , indeed partial, assuming using .net 4, yours should partial well. i'll investigate further.
further edit:
ok, since designer creates *datatable classes nested classes within class inherits dataset, might need same in partial class:
public partial class usersdata { public partial class usersdatatable { public string foo { get; set; } } }
that seems work me.
Comments
Post a Comment