简体   繁体   中英

“Unable to connect to SQL Server database” - ASP.NET configuration

Trying to learn how roles work in ASP.NET.

I've made an empty website an created a database to it with nothing in it.

Here's the connection string:

   <add name="connString"
        connectionString="Data Source=(LocalDB)\v11.0;
        AttachDbFilename='C:\Users\user\Documents\Visual Studio 2012\WebSites\ RolesTutorial\App_Data\base.mdf';
       Integrated Security=True;
       Connect Timeout=30" />

I've installed SQL Express 2012.

What else can I try?

Else u can try entity framework. It's modern and useful method. or if u prefer video tutorials here's a good one

您对SQL Express并没有执行任何操作,连接字符串指向localdb,使用管理研究创建数据库,删除“ attachdbfilename”,然后将数据源更改为指向SQL Express(本地)\\ SQLExpress

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM