how to define a connection string using an app.config file in C# [duplicate]
问题 This question already has answers here : Get connection string from App.config (18 answers) Closed 5 years ago . Currently i manually define my connection string in my C# code: string ConnectionString = "Data Source=C;Initial Catalog=tickets;Integrated Security=True"; SqlConnection Conn = new SqlConnection(ConnectionString); Conn.Open(); In my project i have an app.config file and i can see that it has a connection string. It looks like this: <?xml version="1.0"?> <configuration>