<connectionStrings>
<add name="connstr" connectionString="Data Source=192.168.253.11;Initial Catalog=STRFID;User ID=sa;Password=unionsun;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<appSettings>
<add key="connstr" value="Data Source=192.168.253.11;Initial Catalog=STRFID;User ID=sa;Password=unionsun;" />
</appSettings>
using System.Configuration;
public static string connectionString = ConfigurationManager.AppSettings["connstr"].ToString();
protected static string connectionString = ConfigurationManager.ConnectionStrings["connstr"].ConnectionString.ToString();