Am I understanding correctly, and the database connection string for Linq to SQL is typically stored in the app.config file, in the connectionStrings section?
Are there other places it might be done, typically? Thanks!
Am I understanding correctly, and the database connection string for Linq to SQL is typically stored in the app.config file, in the connectionStrings section?
Are there other places it might be done, typically? Thanks!
This isn't LinqToSql specific, but connection strings for .NET applications are generally stored in the connectionStrings section of the app.config or web.config (depending on the application type).
That said, you can store the connection string anywhere you want as long as you are willing to wire up the infrastructure required to read it into the application and pass it to, for instance, LinqToSql. The LinqToSql data context generally has a constructor that takes a connection string as a parameter.