473,811 Members | 2,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

e.action on rowchanged event not agreeing with dataTable.selec t(dataviewRowSt ate.added)


I am trapping the rowchanged event on a table. I have the following code:

If e.Action = DataRowAction.A dd Then

ds.Merge(CType( sender, DataTable).Sele ct("", "",
System.Data.Dat aViewRowState.A dded))
The funny thing is - the merge operation captures No rows.

This appears to be a big contradiction.. ......

Any idea why this is happening?
Nov 23 '05 #1
1 1755
I've googled this some more and discovered it is a bug in .net 1.1 (fixed in
2.0)

I've tried a work-around to force the insert (listed on a google post):

ds.Tables(e.Row .Table.TableNam e).Rows.Add(e.R ow.ItemArray)

But this yeilds 0 rows in the ds.

If i look at the e.row.itemArray in the command window - I get a row
populated with expected values:

? e.Row.ItemArray
{Length=3}
(0): {System.Guid}
(1): {System.Guid}
(2): #1/1/2006#

But when I run the code to add the row to the DS in the immediate window I
get the following:

ds.Tables(e.Row .Table.TableNam e).Rows.Add(e.R ow.ItemArray)
Referenced object has a value of 'Nothing'.

Please note that the 'ds' is declared as follows: "Dim ds as new dataset"

Is there a solution to this? Do I build a custom datarow by hand and pass
it to my ds? Does everybody just avoid using the rowchanged event for
updating the backend in ADO.NET 1.1 ?.........????

stro" <as***@mnrr.com > wrote in message
news:gA******** *********@torna do.rdc-kc.rr.com...

I am trapping the rowchanged event on a table. I have the following code:

If e.Action = DataRowAction.A dd Then

ds.Merge(CType( sender, DataTable).Sele ct("", "",
System.Data.Dat aViewRowState.A dded))
The funny thing is - the merge operation captures No rows.

This appears to be a big contradiction.. ......

Any idea why this is happening?

Nov 23 '05 #2

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

Similar topics

0
287
by: ZAky | last post by:
In Rowchanged event handler the datasource table do not contain the new row added. The DataRowChangeEventArgs contain information about the new row. So, if i try to use DataAdapter.Update(dataTable) Nothing happend. Using dataTable.Acceptchanges insie rowchanged couse infinite loop(why is that).
0
927
by: -Karl | last post by:
Ok.. I am totally stumped on this one. My site was workign great for awhile until I needed to have a Page_load event added to it. I added it and saw that it wasn't working. After ripping apart my code, I found out my problem was the autoeventwireup="false" was causing my problem. So I then changed it to true and was happy to see my page_load was working. Further testing of my site lead me to my next and current issue. I have a...
5
3014
by: CJ Taylor | last post by:
Hey all, This is probably a dumb question, but still feeling a little strange from Labor day festiviities. Anyways, I want a shared sub, at least something that is easy to call from any one of my classes within the scope of my project (or that which inherits/imports this class). Basically, want them to be able to call a sub defined as
8
1411
by: Aaron Smith | last post by:
If I add a handler to the row changed event of a datatable, it fires when a row has been added, but when in the event, it hasn't actually added the row yet... Is there a way around this? How can I make sure that the row has been added to the dataset during this event? Or is there another one I have to hook into? Thanks, Aaron -- ---
4
1789
by: astro | last post by:
I would like to build some generic code that is able to figure out the correct dataAdapter to apply changes to given a form with several dataAdapters. Any suggestions on the following? Thank you. ====================================== Private Sub SaveChanges(ByVal aContainer As Object)
0
1228
by: Hank | last post by:
Hi experts: I have a setup project which needs to run a batch file after installation. I have a normal custom action added into to the install. How do I get this batch file executed after installation? Thanks! Hank
4
1252
by: jones.jeremyp | last post by:
Ok, I am building a control, and it is a Calendar and a previous and next month buttons. The Calendar is build completely by hand. Now, it is using various properties such as Month, Day, Year to build the calendar itself. My next navigation buttons are manipulating these properties. When the page posts back, the calendar is a month behind what is stored in the properties. To make things more difficult, each day is clickable, so the...
6
4694
by: ronchese | last post by:
Hi. I'm trying to make a criteria string to use in Select() method of a datatable, searching for a date, but it is apparently not working! In one of my tests, I have a datatable with 1 row and a field containing the following value (extracted from Immediate Window): ?dtbSample.Rows(0).Item("COM_STARTDATE") #5/8/2006 9:00:00 AM# {Date} Date: #5/8/2006 9:00:00 AM# (for better understand, consider this date as '2006/05/08')
13
2150
by: pittsim | last post by:
Hi, I need to find a way to update some 400,000 rows of an in-memory datatable. Looping through rows is very slow. here's the code I'm using: protected virtual void SetEditStamps(ref DataSet ds) { int count = 0; if ( ds != null ) {
0
9722
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
9603
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
10644
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
10124
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
7664
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
5550
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
4334
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
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.