Code: Select all
Server={ServerName,Port##};Database={databasename};Trusted_Connection=True;Application Name=MyApp
Code: Select all
private SqlConnection _connection;
_connection = new SqlConnection(connectionString);
_connection.Open();
Code: Select all
System.Security.SecurityException: The operation completed successfully.
at System.Security.Principal.WindowsIdentity.GetCurrentInternal(TokenAccessLevels desiredAccess, Boolean threadOnly)
at System.Security.Principal.WindowsIdentity.GetCurrent()
at System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrentNative()
at System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrent()
at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at [corporate code redacted].ReturnDataTable(String applicationName) in myutil.cs
at [corporate code redacted].Get1() in myutil.cs
at [corporate code redacted]..ctor(String connectionString, String Name) in myutil.cs
at [corporate code redacted].Get2() in myapp.cs
at [corporate code redacted]..ctor() in myapp.cs
at [corporate code redacted].Program.Main(String[] args) in MyProgram.cs