Sharing wizard-created datasets in a solution

Hi there,

I've created a solution that has multiple projects in it.These multiple projects compiles to become .dll dependency files that is used by my application.

I've then used the datasource wizard (vs2005) to convert a large access database to a SQL Express dataset, and placed in under my main application. I have been doing work on it for many months now.

All was well until I realize that I need to use some of the tables from that dataset in those dependency dlls as well. However as they are under a different project (or namespace ) , I can't seem to use them.

1. Is there a way we can share the dataset between projects which is in the same solution I tried copying the same dataset into another project and it came up with all sorts of errors.

2. Alternatively, I can create another datasource in the dependency dll and use that. But I'm afraid that would cause locks when sql express tries to access them the same time Is this a misconception

3. Is there another way out there

Thanks for the help, regards Joseph




Answer this question

Sharing wizard-created datasets in a solution

  • rwbogosian

    Thanks for that reply Matthijs,

    Can I ask, if I do put it into a separate project, would all my current work on the dataset be lost And all my existing link to the current database would be wrong

    Situation for my application.

    Project 2 is dependant on project 1.

    Project Z is in turn dependant on Project 2.

    Currently all my SQL work is being done in Project Z, which has the dataset. However I realized that Project 2 also requires to use the dataset as well. What is the best possible way to go about separating the dataset into another project and relinking it together

    regards,J



  • PerPixel

    Thanks for the tips.

    Just a few questions for you Sohail.

    But first my application is like this:

    Project 2 is dependant on project 1

    Project 2 compiles to become a library class (dll)

    Myapp is dependant on this Project2 library class. Previously all my work as well as my dataset were developed in Myapp. However I just realized that Project 2 would need to have access to this dataset as well.

    My question would be - is it possible to add the reference (myApp) that contains the dataset to Project 2, that it can be accessible to Project2 to use Seing that it myApp is dependant on Project 2.

    What would be the best way to allow the dataset to be shared in this situation

    Regards,J



  • New-Bee

    Yes I have since moved it into a new project, actually recreating it under the same name.

    Then I referenced the new databaset by replacing all the old namespace to the new namespace of the project.

    Thanks for your help.



  • Araki66

    Hi!

    1) You can add the reference of the assembly that contains the dataset to the one where you want to use it. After doing this you should be able to access the dataset.

    2) You can seperate you project into three tier if this is possibility.

    3) Also read on "global namespace" that might be what you want.

    Sohail.



  • StarsFire

    Joseph,

    Your work would not be lost. You will just have to point to the new dataset location everytime you referenced the dataset.

    I advise you to backup your code before you go trying to move the datasets. If things dont work out you have a fallback scenario.

    Good luck!



  • Simon FERQUEL

    Put your datasets in a seperate project.

    Reference this project from all your other solutions.



  • Sharing wizard-created datasets in a solution