Search code examples
c#architecturedatasetreusability

How to figure out how to reference a dataSet in a C# portable class library?


I have 3 different projects that use the same dataTables in the same dataSet.

I'm trying to create a portable library to cut down on the same code across the different projects.

I'm having trouble figuring out how to include a reference for the data-set?

Currently all 3 of my projects have their own data-set and I'm trying to simplify it.

I hope that I'm making sense.!

Please guide me with best possible way..


Solution

  • You need to create N-Tier architecture will solve your problem

    Your project architecture should be like this ,

    Solution(your project) 
    |
    |-  Project 1
    |
    |-  Project 2
    |
    |-  Project 3
    |
    |-  DAL - //Data access layer 
    |
    |-  BL - //your business logic will be here 
    

    and just need reference where you want to use e.g.

    yourproject.Dal.yourclass.yourmethod()
    

    for more information just refer this MVC project link

    You can create same in your asp.net project