Get data source object

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Etienne Charland

    #1

    Get data source object

    I have a DataSource and a DataMember (like with standard bindings). Now, I
    want to write a function that gets the source object from them. So, let's
    say DataSource is a dataset and DataMember is "MyTable.Co l1", I want to
    return MyDataSet.Table s("MyTable")

    I decompiled BindingContext and CurrencyManager classes to see how it can be
    done, and from what I understand, it is done with the TypeDescriptor class,
    like this:

    DataSet ds = new DataSet();
    ds.Tables.Add(" Table1");
    PropertyDescrip tor Prop = TypeDescriptor. GetProperties(d s)["Table1"];

    However, this doesn't work. Prop stays null. So, how am I supposed to do
    that? Am I near the solution or completly off the track?

    Thanks!

    Etienne


Working...