//数据库连接字符串(web.config或app.config来配置)
//<add key="ConnectionString" value="Server=localhost;User Id=root;Password=root;Persist Security Info=True;Database=test" />
protected static string connectionString = "server=localhost;user id=root;password=root;database=asptest"; // ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
<appSettings>
<!--数据库连接设置 -->
<add key="ConnectionString" value="server=localhost; port=3306; user id=root; password=root; database=test; pooling=false; charset=utf8"/>