[英]How to migrate a DataBase created in Visual Studio C# to a SQL Server?
I want to transfer/connect my database that I created in Visual Studio C# to SQL Server Management Studio 2016. I'm developing Hotel Management Software and my database is relative short and I don't have the time to create a new one because of all the code included in my program related to the database.我想将我在 Visual Studio C# 中创建的数据库传输/连接到 SQL Server Management Studio 2016。我正在开发酒店管理软件,我的数据库相对较短,我没有时间创建一个新的,因为我的程序中包含的所有与数据库相关的代码。 I only have one DataSet and three tables.
我只有一个 DataSet 和三个表。 I'm using Windows Authentication but I need to use SQL Server Authentication but I don't know to do that.
我正在使用 Windows 身份验证,但我需要使用 SQL 服务器身份验证,但我不知道该怎么做。
I'll appreciate all the answers to my question.我会很感激我的问题的所有答案。
I figured out how to do it.我想出了怎么做。
First was getting acess to my DataBase.mdf file, so I changed my program path to a "PUBLIC" folder.首先是访问我的 DataBase.mdf 文件,因此我将程序路径更改为“PUBLIC”文件夹。 My was in the USERS and I changed it to C:/ path.
我在用户中,我将其更改为 C:/ 路径。 Then in SQL Server Management, I entered with Windows Authentication first, then I went to "Databases" folder, right cliked, choose Attach, chosse Add, and I connected my Database.mdf in C:/ path.
然后在 SQL 服务器管理中,我先用 Windows Authentication 进入,然后我进入“Databases”文件夹,右键单击,选择 Attach,选择 Add,然后我在 Z0D61F8:370CAD1D4125D7 中连接了我的 Database.mdf:370CAD1D4125D7 After connection, I went to Security, right clicked Login and added a new login.
连接后,我去安全,右键单击登录并添加一个新的登录。 Now I can acess with SQL Server Authentication.
现在我可以使用 SQL 服务器身份验证访问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.