日期:2014-05-17 浏览次数:20627 次
<add key="SqlString" value=" Server=127.0.0.1;Database=dbtraffic;Uid=root;Pwd=1"/>
string con = ConfigurationManager.ConnectionStrings["SqlString"].ConnectionString; using (MySqlConnection cn = new MySqlConnection(con))
using (MySqlConnection cn = new MySqlConnection("server=localhost;user id=root;password=1;database=dbtraffic"))
<appSettings> <add key="SqlString" value=" Server=localhost;Database=dbtraffic;Uid=root;Pwd=1"/> </appSettings> string con = ConfigurationManager.AppSettings["SqlString"]; using (MySqlConnection cn = new MySqlConnection(con)) { //... }