C# Connection To SQL
//添加引用 using System.Data.SqlClient; string connection = System.Configuration.ConfigurationManager.ConnectionStrings["AlexConnection"].ConnectionString; //web.config <connectionStrings> <add name="AlexConnection" connectionString="Server=.;Database=alex;Trusted_Connection=true" providerName="System.Data.SqlClient" /> </connectionStrings>