Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dataset has been lost
Message
De
03/01/2007 03:07:03
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Dataset has been lost
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01181685
Message ID:
01181685
Vues:
67
In my data class, there is a method called SQLUpdate(). In it, the code is as follow:
                oCommand.CommandText = cSQL

                ' Only add the parameters if we have some
                If oParameters2.Count > 0 Then
                    For Each oDataParameter In oParameters2
                        oCommand.Parameters.Add(oDataParameter)
                    Next
                End If

                oDataAdapter.SelectCommand = oCommand
                oDataSet = New DataSet
                oDataAdapter.Fill(oDataSet)
This is executed thousands of times per day. But, today, I got an:

"Object reference not set to an instance of an object."

message on the Fill() command. This is really weird. I cannot find why the oDataSet would be lost as it is just created the line before.

The stack trace is as follow:
at System.Data.ProviderBase.DbReferenceCollection.AddItem(Object value, Int32 tag)
   at System.Data.OleDb.OleDbReferenceCollection.Add(Object value, Int32 tag)
   at System.Data.ProviderBase.DbConnectionInternal.AddWeakReference(Object value, Int32 tag)
   at System.Data.OleDb.OleDbConnection.AddWeakReference(Object value, Int32 tag)
   at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)
   at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   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 Framework.Framework.Data.SQLUpdate(String tcSQL, Boolean tlUpdate)
This was the update line:
UPDATE MagaSche SET ModUser=0,ModDate={^2007/01/03 02:53:53},Hit=? WHERE Numero=?
The parameters have been well set from the loDataProvider object from the data class:
        loDataProvider.ParameterAdd("Hit", oRow("Hit") + 1)
        loDataProvider.ParameterAdd("Numero", oRow("Numero"))
        If Not loDataProvider.SQLUpdate("UPDATE MagaSche " + _
         "SET Hit=" + loDataProvider.ParameterAddSQL("Hit") + " " + _
         "WHERE Numero=" + loDataProvider.ParameterAddSQL("Numero")) Then
            Return False
        End If
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform