- >我使用Windows身份驗證當我登錄到sql與IVS-PC服務器名稱!
我在SQL Server由具有LeitnerBox名數據的基礎上
1.如果正在運行從那裏database
位於則可以使用.
或localhost
爲server name
,因爲它們代表相同的機application
目前該機
或
如果您知道Database
服務器(數據庫可用的機器)的hostname
,您也可以提供您的hostname
。
2.對於您可以給LeitnerBox
想要訪問它。
3.如您使用windows authentication
登錄到sql server
你不需要提供User ID
和Password
注:User ID
和Password
是當您使用SQL-Server Authentication
到需要登錄。
方法1:,如果你不知道hostname
database
位於機器
String ConnectionString ="Data Source=.; Initial Catalog=LeitnerBox;
Integrated Security=True;"
方法2:如果你知道的database
的hostname
位於機器
String ConnectionString ="Data Source=IVS-PC; Initial Catalog=LeitnerBox;
Integrated Security=True;"
4.User ID
and當您使用SQL-Server Authentication
進行登錄時,需要使用。
SqlServer的用戶ID默認爲sa
Sql Server的密碼它是您安裝Sql-Server數據庫時的密碼。
方法3:與Sql-Server Authentication
String ConnectionString ="Data Source=IVS-PC; Initial Catalog=LeitnerBox;
User ID=sa;Password=mypassword;Integrated Security=True;"
用戶???你的意思是'登錄'嗎?連接字符串應該與登錄,而不是用戶。我知道這可能會令人困惑,因爲連接字符串中用於指定登錄名的鍵名稱被稱爲「User Id」。 – Leo
http://www.connectionstrings.com/ – Sklivvz