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
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
Linq to entites 13

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top