Stil doesn't work. Please read my comments below:
Quote:> You did not mention what type of custom control you created i.e.
> DataGrid,MSFlexgrid,etc..
It is a self made user control (.ctl), with a just couple of textboxes.
Quote:> The error message you mentioned happens when ADODC1 RecordSource property
> does not match with the Object.DataSource that you are trying to bind it
> with.
That's not it. Example:
I created a AdoDC1 object, which connects to a SQL query in a database
"SELECT * FROM Companies ORDER BY Name"
If at designtime I set MyObject 's property DataSource to AdoDC1, and I set
the DataBindings correctly (I bind the 'Name' field of my control to the ,
it works fine.
If in my code I try to connect the control to the exact same AdoDC1 object
it doesn't work. Like this:
Set MyObject.DataSource=AdoDC1
And then I'll get the error I mentioned. (Method or datamember not found)
I hope anyone can help me out,
Jos.
Quote:> Ex.
> Design Time
> The ff. codes will automatically populate the DataGrid control(for
> example) with data from Table1.
> ADODC1.RecordSource = Table1
> Datagrid.DataSource = ADODC1
> If your intended output control is designed to show data from Table2 or
> contains other data that does not belong to Table1, then you will get an
> error. The reason the datasource property was highlighted is because your
> custom control is trying to get data that does not match ADODC1
> RecordSource property.
> In short: at Run Time
> Set ADODC1.RecordSource = ""
> Set ADODC1.RecordSource = "the table or SQL statement you want to use"
> Datagrid.DataSource = ADODC1
> HTH