1

我已经做了一个WFA。我需要它能够安装在 5 台计算机上,其中一台是数据库服务器计算机。我想知道如何使用 SQL Server 2008 创建可供所有 5 台机器使用的数据库。

WFA中如何创建数据库,创建连接,以及如何做相关的cording?

请帮忙。我知道如何在本地数据库中执行此操作,但我不知道何时涉及网络。

4

1 回答 1

1

Couple of steps:

  1. Install SQL Server 2008 on your server machine
  2. Create your database using e.g. SQL Server Management Studio and .sql scripts
  3. Set up either SQL Server logins for each user that should connect to SQL Server, or e.g. define a Windows group that has access to SQL Server; give those logins the necessary permissions in your database

  4. Then set the connection string for your application to something like

    server=YourServerName;database=YourDatabase;Integrated Security=SSPI;
    

    if you want to use "integrated security" (e.g. user just accesses SQL Server using this Windows credentials), or set it to:

    server=YourServerName;database=YourDatabase;User Id=User;Password=password
    

    if you want to use explicit SQL Server logins for each computer/user

  5. make sure the client PC's are connected to the network where the SQL Server machine lives, and make sure no firewall is in the way (or if it's there - it allows TCP and UDP traffic on SQL Server's standard port 1433 to pass through)

于 2013-07-23T08:00:29.383 回答