Ser*_*pia 5 sql-server connection-string sql-server-2008-express
它随 Visual Studio 2010 Ultimate 自动安装。我没有为服务器或任何东西创建任何用户。
我正在使用:
string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Trusted_Connection=yes;";
Run Code Online (Sandbox Code Playgroud)
我收到身份验证失败的错误。所以找到了服务器,但我的凭据是错误的。默认登录名和密码是什么?
编辑:仍然无法正常工作!:(
这是我的连接字符串:
string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Integrated Security=SSPI;";
Run Code Online (Sandbox Code Playgroud)
和错误信息:
无法打开登录请求的数据库“SportsStore”。登录失败。用户“ToshibaLaptop\Sergio”登录失败。
如果您使用 SQL Server 身份验证,您可以尝试使用用户名sa
和空白密码,但我不确定这是否是默认情况。集成 Windows 身份验证应该可以工作,因此您应该能够连接您的 Windows 帐户:
string conn = "Data Source=.\SQLExpress;Initial Catalog=mydb;Integrated Security=SSPI;";
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
59258 次 |
最近记录: |