Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

C#App connection to DB throws A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)

$
0
0

Since I upgrade my 32bit c# app from .net 3.5 to .net 4, the following code fragment generates the 0x8007001F error from time to time. The command is a simple stored proc that validates the existence of a customer in a table in Sql server 2008. The program runs Windows server 2008 on VM 32bit or 64bit. I have googled this error's cause but find no results.

    public class SqlServerInterface
    {

        public DataSet ExecuteDataset( String connectionString, int commandTimeout, CommandType commandType, String commandText, DatabaseParameter[] commandParameters )
        {
            // Get a new command from the parameters
            using (SqlCommand command = getSqlCommand(connectionString, commandTimeout, commandType, commandText, GetSqlParameters(commandParameters)))
            {

                // Create an SQL Data Adapter with the command
                using (SqlDataAdapter adapter = new SqlDataAdapter(command))
                {
                    // Create a dataset, fill it and return it
                    using (DataSet dataset = new DataSet())
                    {
                        adapter.Fill(dataset);
                        return dataset;
                    }
                }
            }

        }

A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
System.ApplicationException: A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
   at System.Threading.TimerBase.AddTimerNative(Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark)
   at System.Threading.TimerBase.AddTimer(TimerCallback callback, Object state, UInt32 dueTime, UInt32 period, StackCrawlMark& stackMark)
   at System.Threading.Timer..ctor(TimerCallback callback, Object state, Int32 dueTime, Int32 period)
   at System.Data.ProviderBase.DbConnectionPool.CreateCleanupTimer()
   at System.Data.ProviderBase.DbConnectionPool.Startup()
   at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at SqlServerInterface.ExecuteDataset(String connectionString, Int32 commandTimeout, CommandType commandType, String commandText, DatabaseParameter[] commandParameters) in


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>