C# share data between project files
-
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?
-
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?
-
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."
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?
-
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?
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."