We help IT Professionals succeed at work.

DB Connection Issue

Hi Experts!

Thanks for reading this.

Have a Win console that reads a table on SQL Sever.

Ran it locally and it works.

Ran it on the DEV server (Win 2008) and we have this error:

 ExecuteReader requires an open and available Connection. The connection's current state is closed.

On the DEV server there's an ODBC instance (SomeDB)

Here's the connectionstring for console app:

<add key="SQLConnection" value="Data Source=SeverA\DB1;Initial Catalog=SomeDB;Integrated Security=SSPI" />

*SomeDB = a db name that the table resides

Any ideas what's causing the issue?


Comment
Watch Question

Top Expert 2011
Commented:
Are you logged in as the same user on the server ?

Author

Commented:
yes. Thanks!
Most Valuable Expert 2012
Top Expert 2014
Commented:
Looks like the connection is not opened. Do you have a try catch around the code? Are you doing a msgbox of the error message? The connection could be blocked by a firewall etc.

Author

Commented:
I think I figured it out; it's running under a different AD account. bummers.
Trying to get it to work under the right account. Thanks!

Author

Commented:
We'll; it looks like an account issue; I'll split points. Thanks!