0

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!

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.