简体   繁体   English

具有用户的Visual Studio 2010基于服务的数据库

[英]Visual Studio 2010 Service Based Database With Users

I am sure this is a stupid question, but I was wondering how to create a Service Based Database (SQL Server DB) in Visual Studio 2010 with a user account. 我确定这是一个愚蠢的问题,但是我想知道如何在Visual Studio 2010中使用用户帐户创建基于服务的数据库(SQL Server DB)。 I want this because I am creating a C# desktop application with a database back end. 我想要这个,因为我正在创建一个具有数据库后端的C#桌面应用程序。 When I created this project I created a Serviced Based Database in Visual Studio 2010 and the connection string uses my Windows Login for authentication. 创建此项目时,我在Visual Studio 2010中创建了“基于服务的数据库”,并且连接字符串使用Windows登录名进行身份验证。 Now that I have the application made and want to deploy it onto other machines, it cannot connect to the database because of the connection string. 现在,我已经完成了应用程序的创建并想将其部署到其他计算机上,由于连接字符串的缘故,它无法连接到数据库。 So I was thinking that I can create a user account for the database and use that to connect. 所以我在想可以为数据库创建一个用户帐户,然后使用该帐户进行连接。 Anyone know how to do this? 有人知道怎么做吗? Thanks!!! 谢谢!!!

First off, I myself find the question very clear. 首先,我自己觉得问题很清楚。 Obviously the instance of SQL is using windows authentication whereas Eric R. would like it to use SQL Login instead. 显然,SQL实例使用Windows身份验证,而Eric R.希望它使用SQL登录。 To accomplish this, I would install SQL Management Studio 2008 R2. 为此,我将安装SQL Management Studio 2008 R2。 From there you can connect to your database instance. 从那里您可以连接到数据库实例。 You will want to right click on your server and go to Properties. 您将要右键单击服务器,然后转到“属性”。 From there, in security you can tell it to use SQL Login. 从那里,可以安全地告诉它使用SQL登录。 You will also be able to create user accounts for your database inside of Management Studio. 您还可以在Management Studio中为数据库创建用户帐户。 Let me know if this helps... 让我知道这是否有帮助...

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

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