views:

46

answers:

2

I have access to a database table that has been added as a datasource in project (A). Is there any way to refer to this database table from project (B) WITHOUT adding it to project (B)'s datasource?

i.e.

ProjB.databasetable.GetDataSetSchema

Any ideas would be really appreciated. Thanks guys!

A: 

The database table is not related to the project A in any way. The project A contains a datasource, probably a DataSet, that is used to access the table.

If you would like to reuse that dataset, just add a reference to ProjectA to ProjectB and ProjectA.MyDataSet will be there for you to use.

Sky Sanders
Thanks Sky Sanders, i have added that reference previously and have found that it wont let me access the data from the dataset. It only lets me refer to it as a type, and tells me it cannot be used as an expression? Am i missing something blatant here, or just having an off day?!
Craig
Yea, you are missing something. var ds = new MyDataSet(); then use the tableAdapters to load data. You may have to ensure you have the same connection string element in ProjectB app.config as ProjectA.
Sky Sanders
Thanks very much. I thought it was something stupid i had missed. Hadnt created a new table adapter! Ta!
Craig
A: 

The way is to use remote data server and all application will connect to your server.

You can make this with DataAbstract

but you need to rewrite your application.

Hugues Van Landeghem
dude... really?
Sky Sanders