主机中的连接字符串 [英] Connection string in host

查看:69
本文介绍了主机中的连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<add name="ConnectionString" connectionString="Data Source=(Local);Initial Catalog=db;User ID=myusername; Password=my password" providerName="System.Data.SqlClient"/>
</connectionStrings>









我在aspx f后面的代码中使用此代码ile









and i am using this code in my code behind of aspx file


SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);





但这个错误...



but this error...

Login failed for user "myusername"

推荐答案

这意味着您的凭据无效。请仔细检查用户名和密码,因为这是您的问题。
That means your credentials are not valid. Double-check the username and password, as that is your problem.


这篇关于主机中的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆