M
Michael Maes
Hi,
What would be the best way to Set a property of a class which you don't know at design-time which that would be?
The classes haven't got the same base-class, but they're all "extended" with the same properties, methods, ....
In fact it are classes inheriting from Typed DataSets.
I need to set "MyProperty" on tdsExtended1, tdsExtended2, tdsExtended3, .... while itterating the "DataSetCollection"
Of course the best approach would be to have a BaseClass "MyTypedDataSet" and then implement the TypedDataSets Generated by VisualStudio in it, but I don't think that's possible.
I think I have to use something like:
Dim pi As PropertyInfo = t.GetProperty([PropertyName])
If not pi Is Nothing Then
pi.SetValue(Nothing, True, Nothing)
End If
But I can't get it work. (I guess it's the first parameter)
TIA,
Michael
What would be the best way to Set a property of a class which you don't know at design-time which that would be?
The classes haven't got the same base-class, but they're all "extended" with the same properties, methods, ....
In fact it are classes inheriting from Typed DataSets.
I need to set "MyProperty" on tdsExtended1, tdsExtended2, tdsExtended3, .... while itterating the "DataSetCollection"
Of course the best approach would be to have a BaseClass "MyTypedDataSet" and then implement the TypedDataSets Generated by VisualStudio in it, but I don't think that's possible.
I think I have to use something like:
Dim pi As PropertyInfo = t.GetProperty([PropertyName])
If not pi Is Nothing Then
pi.SetValue(Nothing, True, Nothing)
End If
But I can't get it work. (I guess it's the first parameter)
TIA,
Michael