vs2010 web.config 连接mysql 字符串 有异常。
publicstaticstringConnectionString="Server=localhost;Database=mytest;User=root;Passwo...
public static string ConnectionString = "Server=localhost;Database=mytest; User=root;Password=;Port=3306;Charset=utf8";
这么写可以连接上,但是在Web.Config里添加<connectionStrings>
<add name="ConnectionString" connectionString="Server=localhost;Database=mytest; User=root;Password=;Port=3306;Charset=utf8" />
</connectionStrings>
然后去读取public static string ConnectionString = SmartFamily.Helper.Web.ConfigHelper.ReadAppSettingsValue("ConnectionString")
就报异常Access denied for user ''@'localhost' (using password: NO),求助达人。 展开
这么写可以连接上,但是在Web.Config里添加<connectionStrings>
<add name="ConnectionString" connectionString="Server=localhost;Database=mytest; User=root;Password=;Port=3306;Charset=utf8" />
</connectionStrings>
然后去读取public static string ConnectionString = SmartFamily.Helper.Web.ConfigHelper.ReadAppSettingsValue("ConnectionString")
就报异常Access denied for user ''@'localhost' (using password: NO),求助达人。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询