Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# share data between project files

C# share data between project files

Scheduled Pinned Locked Moved C#
csharpdatabaselinqtutorialquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    classy_dog
    wrote on last edited by
    #1

    For a C# 2008 desktop/console application I want to share a linq to sql (*.dbml file) between 2 different project files in the same solution. I know that I should probably put the linq to sql (*.dbml file) in its own project file with a class libary? Since I do not know how to accomplish this goal, I am wondering if you can point me to a reference on how to accomplish this goal?

    R 1 Reply Last reply
    0
    • C classy_dog

      For a C# 2008 desktop/console application I want to share a linq to sql (*.dbml file) between 2 different project files in the same solution. I know that I should probably put the linq to sql (*.dbml file) in its own project file with a class libary? Since I do not know how to accomplish this goal, I am wondering if you can point me to a reference on how to accomplish this goal?

      R Offline
      R Offline
      RobCroll
      wrote on last edited by
      #2

      I'd do it the right way. You'll be a better developer for it. See Walkthrough: Creating an N-Tier Data Application[^].

      "You get that on the big jobs."

      C 1 Reply Last reply
      0
      • R RobCroll

        I'd do it the right way. You'll be a better developer for it. See Walkthrough: Creating an N-Tier Data Application[^].

        "You get that on the big jobs."

        C Offline
        C Offline
        classy_dog
        wrote on last edited by
        #3

        Your link is good! However, I would like to use linq to sql (*.dbml) files since that is the way I have the code setup currently. I have told my boss that (linq to sql) or linq to the entity framework is the better way to go since that is the newest technology. (My boss has some java experince.) Thus can I setup the class library that connects to the database by using linq to sql and/or linq to some other technology? If so, can you tell me and/or point me to a reference that will accomplish this goal?

        R 1 Reply Last reply
        0
        • C classy_dog

          Your link is good! However, I would like to use linq to sql (*.dbml) files since that is the way I have the code setup currently. I have told my boss that (linq to sql) or linq to the entity framework is the better way to go since that is the newest technology. (My boss has some java experince.) Thus can I setup the class library that connects to the database by using linq to sql and/or linq to some other technology? If so, can you tell me and/or point me to a reference that will accomplish this goal?

          R Offline
          R Offline
          RobCroll
          wrote on last edited by
          #4

          If your talking about non .NET technologies, no. But if you want to create a suit of applications based on .NET, then the n-tier dsign is the way to go. Build a data access library (DAL). Create a business layer (BAL) that references the data access library. Then create seperate applications that reference the business library. You may be able to take your existing code and refactory it out into the different layers and then start building the new applications and share all that common DAL and BAL code. If your forms/pages are making calls directly to the database in your corrent solution: it may be harder.

          "You get that on the big jobs."

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups