简体   繁体   English

将VS2010网站模板与现有数据库一起使用?

[英]Using VS2010 website template with an existing database?

Sorry if this is an obvious question, but my knowledge of asp.net is a bit patchy. 抱歉,如果这是一个显而易见的问题,但是我对asp.net的了解有些零碎。

I need to make a quick website to act as a web frontend to some software I have made. 我需要建立一个快速的网站来充当我制作的某些软件的网络前端。 I just created a website from the Asp.Net website template in VS2010, and was pleasantly suprised to see that this template comes almost fully built - for instance, when handling user registration/login. 我刚刚从VS2010中的Asp.Net网站模板创建了一个网站,很高兴看到该模板几乎完全构建完成-例如,在处理用户注册/登录时。

However, I need the user registration/login system to go through an existing SQL Server database I have created. 但是,我需要用户注册/登录系统来浏览我创建的现有SQL Server数据库。 How do I set this up? 我该如何设置?

I tried changing the connection string from the default: 我尝试更改默认的连接字符串:

<add name="ApplicationServices"
 connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
 providerName="System.Data.SqlClient"/>

to this: 对此:

<add name="ApplicationServices"
 connectionString="Server=MININT-8PNI9PD\SQLEXPRESS;Database=CourtListNotifier; Integrated Security=SSPI;"
 providerName="System.Data.SqlClient"/>

However, this doesn't work - the site complains about missing a required stored procedure. 但是,这不起作用-该网站抱怨缺少必需的存储过程。

How do I solve this? 我该如何解决? I want to get the site working as quickly as possible, and so I want to change the template only a little to meet my needs, without using lots of time to write a large customized login system. 我想使网站尽快运行,因此我只需要更改模板即可满足我的需要,而无需花费大量时间来编写大型的自定义登录系统。

您可以使用aspnet_regsql.exe实用程序来创建一个遵循所需架构的数据库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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