I wrote a tool that queries/updates a database using Linq to SQL. The entity classes autogenerated by Visual Studio are bound to the name of this specific database copy. It looks like if I need to rerun the tool on another copy of the same database (same table names, schema, etc) I need to create entity classes again for that database. Is it possible to create one set of entity classes and have the rest of the program pass in the name of server/database as parameters when creating the data context?
Share
Please use this constructor of DataContext to specify new database connection string – DataContext Constructor