none
Reusing typed DataSet throughout different projects. RRS feed

  • Question

  •  

    Hello Guys,

     

    I'm sort of new at this. I've written several small applications, but it so happens that each one of those applications used a different data scheme. Now I'm facing a different scenario that I did not anticipate. I now have the need to use/reuse the same dataset definition in many projects or solutions. Is there a way that I can import to a new project the dataset including tables, queries, tableadapters, etc. to another project, so I don't have to re-define or rewrite the queries I need all over again?

     

    I'm thinking that I can create a project that handles all the data and then import this project to the different solutions I'll be working on, but I don't know if this is the best approach or if this is even a feasable solution.

     

    If anyone has an idea about this... I would appreciate any input. Thanks in advance.

    Wednesday, October 24, 2007 9:40 PM

Answers

  • Hi,

     

    This is definitively feasible. In the original solution where you created the dataset, add a new project of type Class Library. Name it somthing like DataLayer. Move all your dataset and related code to this project (drag drop in the solution explorer). In the original project, add a reference to the 2nd project.

     

    Then to reuse the DataLayer dll, in the new solution, add a reference to the DataLayer dll created for the first project.

     

    Hope this helps,

    Charles

    Thursday, October 25, 2007 12:02 AM

All replies

  • Hi,

     

    This is definitively feasible. In the original solution where you created the dataset, add a new project of type Class Library. Name it somthing like DataLayer. Move all your dataset and related code to this project (drag drop in the solution explorer). In the original project, add a reference to the 2nd project.

     

    Then to reuse the DataLayer dll, in the new solution, add a reference to the DataLayer dll created for the first project.

     

    Hope this helps,

    Charles

    Thursday, October 25, 2007 12:02 AM
  • Thank you very much cverdon, i tried it and it works like charm. Thanks!

     

    Thursday, October 25, 2007 4:25 PM