2011-02-03 90 views
0

我有在Visual Studio中访问SQL Server中的问题。我正在阅读一个csv文件并将其放入SQL Server数据库。我正在使用DBAccees来做到这一点,但是,当我运行该应用程序时,出现“登录失败的用户”错误。我不确定它为什么这样做,因为用户名和密码是正确的。问题与SQL Server

DBAccess _dba = new DBAccess("server=servername;database=name;password=password;user=username"); 

任何帮助表示赞赏

回答

2

我认为在连接字符串中的用户名参数是错误的。 将其更改为:

DBAccess _dba = new DBAccess 
       ("server=servername; database=name;password=password;uid=username"); 
+0

或'用户ID =` - 福气! – 2011-02-03 16:34:14

0

如果你不能让SQL Server验证的工作,你验证你有一个正确配置的SQL用户设置?有权访问正确的数据库?如果您不需要使用SQL身份验证,并希望使用集成使用一个连接字符串:

服务器= myServerAddress;数据库= MyDatabase的; Trusted_Connection = TRUE;