473,698 Members | 2,467 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 3426
> 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
2022
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
3580
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
1221
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
1631
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
1881
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
4880
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
1518
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
18929
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
1977
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
8678
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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
9166
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...
0
8871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6525
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
4371
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
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
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.