LINQ TO SQL in a library

  • Thread starter Mike Gleason jr Couturier
  • Start date
M

Mike Gleason jr Couturier

Hi,

I often write libraries that rely on a particular table in the application
database...
I used to put a key in the web.config to tell the library which table to
use.. (in the library's config section)

Now I did some LINQ and I'm hooked to it, and I'm writing a new library.
If I generate the code for a table, the datacontext contains a reference to
a database name in the mappings :
[System.Data.Linq.Mapping.DatabaseAttribute(Name="DATABASE_X")]
public partial class XxxxxxxDataContext : System.Data.Linq.DataContext
{ [...] }

Suppose my library always use the same table name, will the generated
datacontext in my library work with any client? (if the table structure
doesn't change and the client is responsible to pass the connection string
to my library)

In summary, I want to use LINQ in a library that rely on a table in a
database, which will be specified by the client application.

Is it possible?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

LINQ to SQL - DataContext 3
GoDaddy MS SQL server 2
effective linq delete 5
Adding modules to library? / package? 1
LINQ DataContext 1
Linq\MSAccess 0
Linq 5
Can't run linq to sql query? 4

Members online

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,733
Latest member
LonaMonzon

Latest Threads

Top