473,734 Members | 2,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataView.get_It em throws a NullReferenceEx ception

What could cause a stack trace like this?

Message:Object reference not set to an instance of an object.
Stack Trace:

at System.Data.Dat aView.GetRecord (Int32 recordIndex)
at System.Data.Dat aView.get_RowVi ewCache()
at System.Data.Dat aView.GetElemen t(Int32 index)
at System.Data.Dat aView.get_Item( Int32 recordIndex)
at myCode.myMethod

--
Jonathan Allen

Nov 17 '05 #1
3 3429
> What could cause a stack trace like this?

Impossible to tell without more information. Perhaps you could post the
relevant part of myCode.myMethod ?

Greetings,
Wessel
Nov 17 '05 #2
Well, at one level it's an ADO.NET bug - the DataView indexer should return
either a valid DataRowView, or throw an IndexOutOfRange Exception. Instead
it's crashed somwhere in setting up the DataView's row cache.

The question is, what have you done to upset it so?

Is the problem reproducible - can you you trap the exception in the
debugger?

Did the failure occur on first use for the view, or later?

How was the DataView and underlying table configured? Was anything
interesting changed (like filters, schema, ...) after initially loading the
table?

---
Nigel Norris
"Jonathan Allen" <x@x.x> wrote in message
news:O7******** ********@TK2MSF TNGP12.phx.gbl. ..
What could cause a stack trace like this?

Message:Object reference not set to an instance of an object.
Stack Trace:

at System.Data.Dat aView.GetRecord (Int32 recordIndex)
at System.Data.Dat aView.get_RowVi ewCache()
at System.Data.Dat aView.GetElemen t(Int32 index)
at System.Data.Dat aView.get_Item( Int32 recordIndex)
at myCode.myMethod

--
Jonathan Allen

Nov 17 '05 #3
> The question is, what have you done to upset it so?

I have no idea. I was hoping to start with a list of "What could have caused
this?", and then work backwards. It is one of those server error log things
that are difficult to track down without knowing the cause. And the code is
way too complex to know where to start.
Is the problem reproducible - can you you trap the exception in the
debugger?
Nope. It is happening (rarely) on our server farm. I think I am just going
to have to right this one off as a mystery.

--
Jonathan Allen
"Nigel Norris" <no****@nospam. com> wrote in message
news:uN******** *****@TK2MSFTNG P09.phx.gbl... Well, at one level it's an ADO.NET bug - the DataView indexer should
return either a valid DataRowView, or throw an IndexOutOfRange Exception.
Instead it's crashed somwhere in setting up the DataView's row cache.

The question is, what have you done to upset it so?

Is the problem reproducible - can you you trap the exception in the
debugger?

Did the failure occur on first use for the view, or later?

How was the DataView and underlying table configured? Was anything
interesting changed (like filters, schema, ...) after initially loading
the table?

---
Nigel Norris
"Jonathan Allen" <x@x.x> wrote in message
news:O7******** ********@TK2MSF TNGP12.phx.gbl. ..
What could cause a stack trace like this?

Message:Object reference not set to an instance of an object.
Stack Trace:

at System.Data.Dat aView.GetRecord (Int32 recordIndex)
at System.Data.Dat aView.get_RowVi ewCache()
at System.Data.Dat aView.GetElemen t(Int32 index)
at System.Data.Dat aView.get_Item( Int32 recordIndex)
at myCode.myMethod

--
Jonathan Allen


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2023
by: Tom | last post by:
For some strange reason my WinForms app occasionally throws a System.NullReferenceException upon invoking the Clear() method. The app will work fine for a long period of time and then all of a sudden this exeption is thrown and after that you just cant ever clear the ListView control again - even though messages still go into it and are displayed correctly. Anybody have any idea what could be causing this?
3
3584
by: Sébastien Ros | last post by:
During the process of an XML document, I have to make a SelectNodes() call on an XmlDocument. It returns an isntance of XPathNodeList. I can call it several times but at one point, the result can't be iterated. Here is the code: XmlNodeList nodes = _Document.SelectNodes(myXpathQuery); foreach(XmlNode n in nodes) { ... }
0
1222
by: wackyphill | last post by:
I loop thru a Filtered DataView and update several of the rows in the loop. The problem is once a ropw gets altered the DataView's Count Seems to be altered causing me to access rows that it doesn't think exist: DataView runView = new DataView( _db.DS.Tables, where, null, DataViewRowState.CurrentRows); foreach( DataRowView row in runView ) {
1
1635
by: Eduard Ralph | last post by:
Hi, I have a weird exception happening when calling the new operator. I'm not sure if this is the intended reaction to the situation or is actually a problem I've got. In any case a different error message would be helpful. I would like to know your thoughts on this problem. The situation: I have an external Library of C Functions and Structures which are
2
1888
by: Anup Daware | last post by:
Abstract: I want to filter a dataview with a value where column name have a SPACE. Description:- I bind a dataview to a datagrid, The query which is fetching the results in Dataset is something like this:- Select POSTAL_ADDRESS as "Postal Address" from Emp where .... Now the column name in Dataview is "Postal Address" which is having a space, with this column name when I am filtering the Dataview like:- DataViewAddress.RowFilter = ...
2
4884
by: Karen Hill | last post by:
I have a datagridview control on a form with a few of the columns being DataGridViewCheckBox. Whenever I click on the checkbox to create a new record I get a NullReference Exception thrown even though I check for NULL using System.Convert.IsDbNull function. What gives? I'm catching the NullReferenceException, although I know it is not correct to do for normal program flow. What is the solution?
0
1522
by: neeraj | last post by:
Hi, all Could anny one give me help how can I use like operator with these data types "integer , datetime or boolean" in DataView.RowFilter Actually when I try to get the data from dataview using rowfilter with like operator Its working fine when data type of searching column is "string" . But if data type is "integer , datetime or boolean" its throws
2
18938
by: neeraj | last post by:
Hi, all Could anny one give me help how can I use like operator with these data types "integer , datetime or boolean" in DataView.RowFilter Actually when I try to get the data from dataview using rowfilter with like operator Its working fine when data type of searching column is "string" . But if data type is "integer , datetime or boolean" its throws
7
1979
by: Zytan | last post by:
I just got the strangest error. I have exception code that catches a null reference exception: catch (NullReferenceException ex) { ... } The handling code does nothing but print out data from within the object, ex. So, nothing is changed. And I've found that the exception object, ex, ITSELF is null! So, by accessing it to print its innards, it throws another NullReferenceException (which is, of course, unhandled)! Printing...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.