Strange Update Problem - NullReferenceException INSIDE of Update Method!

  • Thread starter Thread starter John Saunders
  • Start date Start date
J

John Saunders

I'm writing a program which is meant to write Event Log entries into a SQL
Server database. I'm using a SqlDataAdapter with stored procedures generated
by the Configure Data Adapter wizard. I'm using the strongly-typed dataset
this generated for me (EntryDS). The one table is EventLogEntries, so the
row is EventLogEntriesRow.

For each Event Log entry, I get a row with NewEventLogEntriesRow, fill it
in, and then add it to the DataSet with AddEventLogEntriesRow. I wait until
all rows are filled in before doing the Update.

The problem comes when I do the Update. It fails as follows:
Debug.ListCallStack
Index Function
----------------------------------------------------------------------------
----
1
system.data.dll!System.Data.Common.DbDataAdapter::Update(System.Data.DataRow
[] dataRows = {Length=10000}, System.Data.Common.DataTableMapping
tableMapping = {System.Data.Common.DataTableMapping}) + 0x766 bytes
2
system.data.dll!System.Data.Common.DbDataAdapter::Update(System.Data.DataRow
[] dataRows = {Length=10000}) + 0x215 bytes
*3 EventLogTestConsole.exe!EventLogTestConsole.DataAccess.Update()
4 EventLogTestConsole.exe!EventLogTestConsole.MainClass.Main(string[] args =
{Length=0})

[The "10000" is due to a failed attempt to make it work a little at a time.
Almost the same stack occurs when I just use Update(DataSet)]

This is with Framework 1.0.3705.288.

Through the magic of "binary search", I discovered that I can successfully
write 27011 rows, but not 27012. 27012 and above cause the exception.

I can't figure out what's going on here. I thought there might be some bad
value in row 27012, but I looked at it, and it's almost identical to 27011.
Beyond that, I have no clue, since it's not obvious where I'm supplying a
null. I wonder if someone who knows the Framework better than I do can give
me something to look for?
 
Some suggestions:

1. Does the same problem occur if you update the data every 10000 rows?

2. How did you update the data programmatically?

3. Apply .Net Framework 1.1 and MDAC 2.8



Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "John Saunders" <[email protected]>
| Subject: Strange Update Problem - NullReferenceException INSIDE of Update
Method!
| Date: Sun, 21 Sep 2003 17:24:15 -0400
| Lines: 46
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: pool-151-199-40-177.bos.east.verizon.net 151.199.40.177
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:61733
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| I'm writing a program which is meant to write Event Log entries into a SQL
| Server database. I'm using a SqlDataAdapter with stored procedures
generated
| by the Configure Data Adapter wizard. I'm using the strongly-typed dataset
| this generated for me (EntryDS). The one table is EventLogEntries, so the
| row is EventLogEntriesRow.
|
| For each Event Log entry, I get a row with NewEventLogEntriesRow, fill it
| in, and then add it to the DataSet with AddEventLogEntriesRow. I wait
until
| all rows are filled in before doing the Update.
|
| The problem comes when I do the Update. It fails as follows:
|
| >Debug.ListCallStack
| Index Function
|
----------------------------------------------------------------------------
| ----
| 1
|
system.data.dll!System.Data.Common.DbDataAdapter::Update(System.Data.DataRow
| [] dataRows = {Length=10000}, System.Data.Common.DataTableMapping
| tableMapping = {System.Data.Common.DataTableMapping}) + 0x766 bytes
| 2
|
system.data.dll!System.Data.Common.DbDataAdapter::Update(System.Data.DataRow
| [] dataRows = {Length=10000}) + 0x215 bytes
| *3 EventLogTestConsole.exe!EventLogTestConsole.DataAccess.Update()
| 4 EventLogTestConsole.exe!EventLogTestConsole.MainClass.Main(string[]
args =
| {Length=0})
|
| [The "10000" is due to a failed attempt to make it work a little at a
time.
| Almost the same stack occurs when I just use Update(DataSet)]
|
| This is with Framework 1.0.3705.288.
|
| Through the magic of "binary search", I discovered that I can successfully
| write 27011 rows, but not 27012. 27012 and above cause the exception.
|
| I can't figure out what's going on here. I thought there might be some bad
| value in row 27012, but I looked at it, and it's almost identical to
27011.
| Beyond that, I have no clue, since it's not obvious where I'm supplying a
| null. I wonder if someone who knows the Framework better than I do can
give
| me something to look for?
| --
| John Saunders
| Internet Engineer
| (e-mail address removed)
|
|
|
 
Kevin Sun said:
Some suggestions:

1. Does the same problem occur if you update the data every 10000 rows?

It did. I will try to create a simplified reproducer.
2. How did you update the data programmatically?

Originally, I just used: dataAdapter.Update(dataSet, "TableName"). The stack
trace supplied was from an attempt to reduce the work that "Update" needed
to do. On that run, I had code which filled a 10000-element DataRow array
and used dataAdapter.Update(dataRow[]).
3. Apply .Net Framework 1.1 and MDAC 2.8

We will not be able to do this, as corporate standards forbid.
 
Back
Top