473,473 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

error "object refe..."

Hi,
I've the "object reference not set to an instance of an abject" error in the
folowing code (initialise a datatable's rows to 0)
this is hapening for the 2nd field (taxe) of the 2nd row (the first is ok!!)

DSFrm.Tables("test").DefaultView.RowFilter = True

For k = 0 To DSFrm.Tables("test").DefaultView.Count - 1

DSFrm.Tables("test").DefaultView(k).Item("price") = 0

DSFrm.Tables("test").DefaultView(k).Item("taxe") = 0

Next

Any help please???
Nov 24 '06 #1
2 1312
touf,

Often this kind of trouble happens when the field description ("taxe") is
not in the right case.

Cor

"touf" <to****@hotmail.comschreef in bericht
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi,
I've the "object reference not set to an instance of an abject" error in
the folowing code (initialise a datatable's rows to 0)
this is hapening for the 2nd field (taxe) of the 2nd row (the first is
ok!!)

DSFrm.Tables("test").DefaultView.RowFilter = True

For k = 0 To DSFrm.Tables("test").DefaultView.Count - 1

DSFrm.Tables("test").DefaultView(k).Item("price") = 0

DSFrm.Tables("test").DefaultView(k).Item("taxe") = 0

Next

Any help please???


Nov 24 '06 #2
I suspect, for starters, you need to get rid of the
"DSFrm.Tables("test").DefaultView.RowFilter = True" line. I don't know what
you intended, but the default for a RowFilter is all rows.

Also, why use the DefaultView at all? It just passes the changes to the
datatable anyway...

In VB, instead of FORTRAN (pseudo code if it doesn't work ;) :

For row as DataRow in DSFrm.Tables("test").Rows
row.Item("price") = 0
row.Item("taxe") = 0
Next row

HTH,
Prester John

"touf" <to****@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
Hi,
I've the "object reference not set to an instance of an abject" error in
the folowing code (initialise a datatable's rows to 0)
this is hapening for the 2nd field (taxe) of the 2nd row (the first is
ok!!)

DSFrm.Tables("test").DefaultView.RowFilter = True

For k = 0 To DSFrm.Tables("test").DefaultView.Count - 1

DSFrm.Tables("test").DefaultView(k).Item("price") = 0

DSFrm.Tables("test").DefaultView(k).Item("taxe") = 0

Next

Any help please???


Nov 24 '06 #3

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

Similar topics

4
by: Danny | last post by:
Hi I don't understand why I keep getting "Error: Object expected" I tried different things and haven't been able to solve it. I'm a newbie so I'm not sure what I'm doing wrong. The debugger breaks...
0
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops...
18
by: Microsoft | last post by:
When I try this in my code I alwas get an errormessage: "Object reference not set to an instance of an object" Dim g As System.Drawing.Graphics g.DrawString("Test", New Font("Arial", 12,...
0
by: Martin Widmer | last post by:
Hello again! I have a datagridview control on my form and am using VS.Net 2005. One column is set up as combo box column, and when I try to set the datasource for that combobox column at design...
4
by: Phil | last post by:
Hi, This code gives an javascript error: "Object required" and never let see the Alert window. in code-behind: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As...
2
by: =?Utf-8?B?QmFkaXM=?= | last post by:
I'm doing a server side automation(I know it's bad but..) and its working fine locally and when accessing it from a remote machine using web browser is was giving me this error"Retrieving the COM...
5
by: Diego Ruiz | last post by:
Hi!! my english is not too good, but i'll try it I have a javascript code: function executeCommands(inputparms) { // Instantiate the Shell object and invoke its execute method. ...
10
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred."...
2
by: =?Utf-8?B?U3dhcHB5?= | last post by:
hi, I am working on application in this i am using two files. In first (consider A) file i am calling the function of other file (consider B). In that function of file B i am calling the method...
5
by: dotnetnovice | last post by:
Hi everybody actually i was trying to insert some records in to SQL server through C# Wndows Aplication and during that i face an error "Object reference not set to an instance of an object." and...
0
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,...
0
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...
0
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...
0
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,...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.