How can you specify a connection string in a .NET application configuration file?

  • By adding a section and defining a element within it
  • By embedding the connection string directly into the code
  • By using a predefined system variable
  • By using a separate text file for storing connection strings
In .NET applications, connection strings are typically stored in the application configuration file (app.config or web.config). This can be done by adding a section within the configuration file and defining one or more elements, each containing the connection string details. This approach allows for easy maintenance and modification of connection strings without modifying the code.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *