Andreas,
I haven't tested the following code, but it *should* work.
Type typeToUse = objectToUse.GetType();
foreach(PropertyInfo pi in typeToUse.GetProperties(BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public))
{
if (pi.PropertyType == typeof(SqlDataAdapter))
{
SqlDataAdapter da = pi.GetValue(objectToUse, new object[0]) as
SqlDataAdapter;
da.Update(myDataSet);
}
}
> Hi, I have trouble finding info on the following:
>
[quoted text clipped - 17 lines]
> yours
> Andreas Knudsen
Andreas.Knudsen(AT)bekk.no - 23 May 2005 10:17 GMT
Thanks for answer ,but:
> Andreas,
>
> I haven't tested the following code, but it *should* work.
>
> Type typeToUse = objectToUse.GetType();
which object would "objectToUse" be?
would that be the class that contains several sqlDataAdapters?
would that be a null object in which to place the dataadapter once it is
located using reflection?
or do you presume that objectToUse is the adapter that I am looking for?
yours
Andreas
Jorge L Matos [MCSD.NET] - 23 May 2005 18:12 GMT
"objectToUse" is the object that cotains the SqlDataAdapter objects as
properties.
For example:
class MyDataAccessObject
{
SqlDataAdapter PubsAdapter
{
get {[omitted code]}
set {[omitted code]}
}
SqlDataAdapter NorthWindAdapter
{
get {[omitted code]}
set {[omitted code]}
}
}

Signature
Jorge L. Matos
> Thanks for answer ,but:
>
[quoted text clipped - 13 lines]
> yours
> Andreas