Visual Studio - 将本地数据库转换为SQL Server数据库 [英] Visual Studio - Converting a local database to SQL Server Database

查看:273
本文介绍了Visual Studio - 将本地数据库转换为SQL Server数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我花了几个月的时间在visual studio中创建一个Web应用程序,目的是将它发布到Azure。它使用VS提供的单用户身份验证选项。



当我第一次创建Web应用程序并注册用户时,它在本地数据库中创建了aspnet表。当我第一次启动应用程序时,我真的不知道这意味着什么,但我在相同的本地数据库中创建了我的应用程序所需的所有表格。



现在我已经完成了应用程序并试图发布Web应用程序 - 我在尝试访问数据库时遇到错误。我期望 - 因为它仍然是一个本地数据库。



但我不知道如何将本地数据库转换为可以部署到azure的东西,以及然后在如何在我的网络应用程序中引用新部署的数据库。




  • 如何/我可以将其转换为SQL Server数据库项目,以便我可以在线发布

< p style ="padding-right:0px;字体大小:15像素;行高:继承; font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;垂直对齐:基线;明确:两者;颜色:#242729">
我曾尝试阅读微软文档,但它们适用于旧版本的visual studio。



我考虑过创建一个新项目,然后首先确保我的网络应用程序连接到SQL Server数据库项目,这样我就可以发布这两个项目,但那么我的应用程序将如何知道不创建本地数据库中的AspNet表并使用我的SQL Server数据库
项目。




  • 如何确保单用户身份验证表不是在本地创建的,
    而是在数据库项目中创建,以便可以部署它们

我无法解决的问题是如何确保将单用户身份验证表(创建时)放在我想要的位置(在这种情况下,
a SQL Server数据库项目在与Web应用程序相同的解决方案中。


解决方案

嗨impojr,


欢迎来到MSDN论坛。


请参阅您的描述,此问题与ASP.NET Web应用程序开发有关。由于我们的论坛是讨论VS IDE,请重定向到这个
适当的论坛: https://forums.asp.net/ 并开始寻找更专业的支持,感谢您的理解。


BTW,我找到了一个文件:

在Azure中使用SQL数据库构建ASP.NET应用程序
可能对您的问题有帮助。如果没有,抱歉我的错误建议,我提到的上述论坛将会提供更好的支持
J





祝你好运,


萨拉


I've spent the last few months creating a web application in visual studio, with the intention of publishing it to Azure. It uses the Single User Authentication option that VS provides.

When I first created the web application and registered a user it created the aspnet tables in a local database. I didn't really know what that meant when I first started the app, but I created all my tables that I needed for my app in the same local database.

Now that I've completed the application and tried to publish the web app - I get an error on trying to access the database. I expected that - because it's still a local database.

But I have no idea how to convert a local database to something that can be deployed to azure, and then on top of that how to reference that newly deployed database in my web app.

  • How do I/Can I convert it to a SQL Server Database Project so I can publish it online?

I've tried reading the Microsoft documents but they are for the old versions of visual studio.

I have considered creating a new project and then first making sure my web app is connected to a SQL Server Database Project so I can publish both, but then how will my app know not to create the AspNet tables in the local database and use my SQL Server Database Project.

  • How can I make sure that Single User Authentication Tables are not created locally, and instead are creating in a Database Project so they can be deployed

What I can't wrap my head around is how to ensure the Single User Authentication tables (when created) are placed where I want them to go (in this case, a SQL Server Database Project in the same Solution as the Web Application).

解决方案

Hi impojr,

Welcome to the MSDN forum.

Refer to your description, this issue is about ASP.NET Web application development. Since our forum is to discuss the VS IDE, please redirect to this appropriate forum: https://forums.asp.net/ and start a new thread to seek for a more professional support, thank you for your understanding.

BTW, I found a document: Build an ASP.NET app in Azure with SQL Database that maybe helpful for your issue. If not, sorry for my wrong suggestion, the above forum that I mentioned will provide a better support J

Best regards,

Sara


这篇关于Visual Studio - 将本地数据库转换为SQL Server数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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