SQLConnection Open() throws exception Instance Failure.
-
Hello guys and girls. I'm creating a Windows service with .NET, C# and SQL Server. I have a strange problem with the SQLConnection class. Whenever I choose to call the "Open()" method. It throws an exception with message: "Instance Failure". That's it. Nothing else, just that simple message. :confused: What could be wrong? I've checked the following: - The database server is running. - The computer do have access to the database server (some of my other projects can access the data, and they use the same connection framework as the Windows service). - My user has access to the database. - If I install and run the service on the same computer as the database server, it still doesn't work. Any clues would be appreciated! Thanks in advance! :) /S
-
Hello guys and girls. I'm creating a Windows service with .NET, C# and SQL Server. I have a strange problem with the SQLConnection class. Whenever I choose to call the "Open()" method. It throws an exception with message: "Instance Failure". That's it. Nothing else, just that simple message. :confused: What could be wrong? I've checked the following: - The database server is running. - The computer do have access to the database server (some of my other projects can access the data, and they use the same connection framework as the Windows service). - My user has access to the database. - If I install and run the service on the same computer as the database server, it still doesn't work. Any clues would be appreciated! Thanks in advance! :) /S
u may need to install sql server service pack 2
-
u may need to install sql server service pack 2
-
Perhaps. But I still don't understand, why my other applications, that use the exact same framework, can access the server's data. This makes no sense. Best regards Soeren
-
I have noticed, that the instance failures is caused by an InvalidOperationException, whenever I call the Open() method of the SQLConnection object. But it still makes no sense. Could it be a db permission problem? /Soeren
Okay. Here is a semi-solution to the problem: It is a permission problem. When the Windows service is running, it uses some obscure username and password to contact the database server. Even though I tell the computer to run the service as a specific user, it still does not work. Then I tried to use SQL authentication instead of integrated security. Now it works. So my conclusion is: Permission problems. If anyone has any idea on how this service/run-as-user-thing works. An explanation would be most helpfull. Thanks in advance. /Soeren
-
Okay. Here is a semi-solution to the problem: It is a permission problem. When the Windows service is running, it uses some obscure username and password to contact the database server. Even though I tell the computer to run the service as a specific user, it still does not work. Then I tried to use SQL authentication instead of integrated security. Now it works. So my conclusion is: Permission problems. If anyone has any idea on how this service/run-as-user-thing works. An explanation would be most helpfull. Thanks in advance. /Soeren