Impersonation succeeds but database connection fails. I have C# (. NET 4. SQL Server 2. 01. Test(Windows. Identity ident). Windows. Impersonation. Context ctx = ident. Impersonate()). using (Sql. Connection con = new Sql. Connection("Data Source=My. Server; Initial Catalog=My. Database; Persist Security Info=False; Integrated Security=SSPI; Network Library=dbmssocn")). Open(). ctx. Undo(). The Open() method throws the following exception every time: System. Data. Sql. Client. Sql. Exception (0x. A network- related or.Auction Management Ebay Listing Software . Free Alternative To Fireworks Adobe Wiki . ![]() Verify. that the instance name is correct and that SQL Server is configured to. TCP Provider, error: 0 - No. The impersonation is succeeding because if I add tracing like this: public static void Test(Windows. Identity ident). using (Text. Writer. Trace. Listener listener = new Text. ![]() In this article you will learn about ASP.NET Interview questions and answers. ยท I don't see anything about the Central Administration Site. If I go into IIS Manager, under the Server (DC01), under Sites, I can find the following. ![]() Writer. Trace. Listener(@"C: \temp\trace. Windows. Impersonation. Context ctx = ident. Impersonate()). listener. When I was trying to connect to SQL Server using the following code SqlConnection con = new SqlConnection("Server= localhost, Authentication=Windows Authentication. Write. Line("Impersonated"). Sql. Connection con = new Sql. Connection("Data Source=My. Server,My. Port; Initial Catalog=My. Database; Persist Security Info=False; Integrated Security=SSPI; Network Library=dbmssocn")). Write. Line("About to open connection; Windows. Avast Internet Security 8 Final Rarbg . Identity. Get. Current(). Name = " + Windows. Identity. Get. Current(). Name). con. Open(). Undo(). listener. Write. Line("Impersonation undone"). I get this: Impersonated. About to open connection; Windows. Identity. Get. Current(). Name = My. Domain\My. User. If I put the exact same connection string in a . My. Domain\My. User" account on the same machine, and click Test Connection, it succeeds. Since that's the case, I just don't see how the problem could be a firewall or anything of that nature. Does anyone know what could be going wrong? I do not have access to log onto the database server itself, so I cannot check its event log (etc.) at this point.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |