473,569 Members | 2,799 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 3421
> 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
2012
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...
3
3567
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
1219
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
1625
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...
2
1872
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...
2
4873
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...
0
1501
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...
2
18901
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...
7
1975
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...
0
7697
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7672
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...
0
6283
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...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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...

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.