简体   繁体   English

SQL Server 2008 R2连接字符串

[英]SQL Server 2008 R2 connection string

HI people. 嗨人。

I had SQL Server 2005 on Windows XP 32bit and just used this connection string 我在Windows XP 32bit上安装了SQL Server 2005,并且只使用了这个连接字符串

Server=.\SQLEXPRESS;database=GroupALD; Integrated Security=True" 

Now I have Windows 7 64bit and SQL Server 2008 R2 I'm trying to connect database with same string but its shows this error 现在我有Windows 7 64位和SQL Server 2008 R2我正在尝试使用相同的字符串连接数据库,但它显示此错误

Cannot open database "GroupALD" requested by the login. 无法打开登录请求的数据库“GroupALD”。 The login failed. 登录失败。 Login failed for user 'lester\\les'. 用户'lester \\ les'登录失败。

Can somebody help me? 有人能帮助我吗?

I'm using C# and Winforms 我正在使用C#和Winforms

是的,试试connectionstrings.com

Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

The error message is pretty clear: 错误消息非常清楚:

Cannot open database "GroupALD" requested by the login. 无法打开登录请求的数据库“GroupALD”。 The login failed. 登录失败。
Login failed for user 'lester\\les' . 用户'lester \\ les'登录失败

Your user doesn't have a valid login on your new database - it's not a connection-string related issue - you need to create a login for lester\\les on your new server and create a user in the GroupALD database for that login. 您的用户在新数据库上没有有效登录 - 这不是与连接字符串相关的问题 - 您需要在新服务器上为lester\\les创建登录,并在GroupALD数据库中为该登录创建用户。

See : how to create a SQL Server Login 请参阅: 如何创建SQL Server登录

Can you connect to your express edition using SQL Server Management Studio of R2 ? 您可以使用R2的SQL Server Management Studio连接到您的快速版吗?

One workaround i can suggest is to export the database from express to R2 if you can connect to R2 using your connection string . 我建议的一种解决方法是,如果可以使用连接字符串连接到R2,则将数据库从express导出到R2。

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

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