Problem with dataset references

P

Peter

Hi,

Let's assume I have a project called Main that contains most of the forms
and functionality of my application. Within the Main project is a definition
of a strongly-typed dataset and an instance of that dataset. The dataset
definition subsists as an XSD file, a VB file, and an XSX file.

Now in a separate project I am designing a control to be used in Main. The
control needs to have within it an instance of the typed dataset from the
Main project, but as it is, the dataset is not in the namespace of the
control project. So I can't use dataset-specific methods with it, which
would greatly simplify my life. I can use a generic dataset, but that does
away with most of the safety-net features of having a typed dataset in the
first place.

I have added a reference to the Control into the Main project (naturally) so
I can use the control. But I can't add a reference to the Main project into
the Control project because there's no DLL file. I thought about putting the
dataset in its own project and compiling it somehow, but that seems weird
and doesn't make any sense to me... how do you compile something that
doesn't actually have any executable code?

So how can I get the Control project to "know about" that dataset type?
 
C

Cor Ligthert [MVP]

Peter,

As far as I understand your problem, than you have to set a reference to
your seperated project.

Projects->Add Reference -> Projects and choose it.

You can set an import too, to avoid to repeat the namespace everytime.

Cor
 
P

Peter

Cor Ligthert said:
Peter,

As far as I understand your problem, than you have to set a reference to
your seperated project.

Projects->Add Reference -> Projects and choose it.

You can set an import too, to avoid to repeat the namespace everytime.

I did try that, but the error it gave me was something along the lines of,
"can't add a reference to this project; there is no DLL file."

I ended up just putting the dataset in its own class library project and
referencing that from both primary projects.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top