Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dataset has been lost
Message
From
03/01/2007 03:07:03
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
Dataset has been lost
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01181685
Message ID:
01181685
Views:
66
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
Next
Reply
Map
View

Click here to load this message in the networking platform