ConfigurationManager.ConnectionStrings["connstring"].ConnectionString
<connectionStrings> <add name="connstring" connectionString="server=.;uid=sa;pwd=111111;database=database" providerName="System.Data.SqlClient"/> </connectionStrings>