asp.net web.config連資料庫

摘要:asp.net web.config連資料庫

 

        SqlConnection Conn = new SqlConnection(ConfigurationManager.ConnectionStrings["AMIConnectionString2"].ConnectionString.ToString());
 
webconfig
 
 <add name="AMIConnectionString2" connectionString="Data Source=.;Initial Catalog=AMI;Integrated Security=True"
   providerName="System.Data.SqlClient" />