aspnet_regsql-登录 [英] aspnet_regsql - login

查看:63
本文介绍了aspnet_regsql-登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用asp.net 4.0并尝试实现登录功能...
我在名为LoginDB的sql服务器上创建了一个数据库,并向其添加了用户myUser和密码.
网站管理工具显示为:
在应用程序配置中找不到连接名称"ApplicationServices",或者连接字符串为空

你知道我该怎么做才能解决这个问题吗?
谢谢

Hi,
I am using asp.net 4.0 and trying to implement the login functionalities...
I created a database on sql server called LoginDB and added the user myUser with password to it.
The website administration tool shows as:
The connection name ''ApplicationServices'' was not found in the applications configuration or the connection string is empty

Do you know what I have to do to solve this please?
Thanks

推荐答案

检查是否在Web中编写了连接字符串.配置.
像这样的东西.
如果您的连接字符串名称是myconnectionstring,并且在后面的aspx代码中,则必须使用相同的名称.


Check whether you have written connection string in web. config.
something like this.
If your connection string name is myconnectionstring and in the aspx code behind, you have to use same name.


<connectionstrings>
<add name="<b>myConnectionString</b>" connectionstring="server=localhost;database=myDb;uid=myUser;password=myPass;" />
</connectionstrings>



要将连接字符串读入代码中,请使用ConfigurationSettings类.

字符串connStr = ConfigurationManager.ConnectionStrings [" myConnectionString "].ConnectionString;


您可以在代码中检查两者是否都匹配吗?



To read the connection string into your code, use the ConfigurationSettings class.

string connStr = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;


Can you check in your code whether both matches?


这篇关于aspnet_regsql-登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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