473,699 Members | 2,530 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Weird dataset.getchan ges problem

Hello there,

I have the following code; I do this as a work around for a
dataset.haschan ges method which doesnt appear to work correctly either

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(D ataRowState.Add ed) Is Nothing Then hasChanges=true
If Not dt.GetChanges(D ataRowState.Mod ified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(D ataRowState.Del eted) Is Nothing Then
hasChanges=true
Next

On some (not all) of my datatables in the dataset, Visual Studio is claming
that certain columns do not exist when I hit the first dt.getchanges line.
The column that it claimes does not exist are not in the datatable
(according to the dataset visualiser)
I have tried regenerating my dataset.

Does anyone know what could be going on? :( I cant figure it out...
Thank you
John
Jun 27 '08 #1
3 2335
John,

This sound strange

On some (not all) of my datatables in the dataset, Visual Studio is claming
that certain columns do not exist when I hit the first dt.getchanges line.
The column that it claimes does not exist are not in the datatable
(according to the dataset visualiser)

The GetChanges creates a real copy of your datatable, I have never seen
this, maybe it uses XML serializing behind the scene and then avoid
probably empty columns, can you check that? Would be interesting.

Cor
"John Sheppard" <sp**@nospam.co mschreef in bericht
news:g2******** *@news2.newsguy .com...
Hello there,

I have the following code; I do this as a work around for a
dataset.haschan ges method which doesnt appear to work correctly either

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(D ataRowState.Add ed) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(D ataRowState.Mod ified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(D ataRowState.Del eted) Is Nothing Then
hasChanges=true
Next

On some (not all) of my datatables in the dataset, Visual Studio is
claming that certain columns do not exist when I hit the first
dt.getchanges line. The column that it claimes does not exist are not in
the datatable (according to the dataset visualiser)
I have tried regenerating my dataset.

Does anyone know what could be going on? :( I cant figure it out...
Thank you
John
Jun 27 '08 #2
Thanks cor, I will check that out and report back. Sorry for the delay, it
was a long weekend here.
John

"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:B2******** *************** ***********@mic rosoft.com...
John,

This sound strange

On some (not all) of my datatables in the dataset, Visual Studio is
claming
that certain columns do not exist when I hit the first dt.getchanges line.
The column that it claimes does not exist are not in the datatable
(according to the dataset visualiser)

The GetChanges creates a real copy of your datatable, I have never seen
this, maybe it uses XML serializing behind the scene and then avoid
probably empty columns, can you check that? Would be interesting.

Cor
"John Sheppard" <sp**@nospam.co mschreef in bericht
news:g2******** *@news2.newsguy .com...
>Hello there,

I have the following code; I do this as a work around for a
dataset.hascha nges method which doesnt appear to work correctly either

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(D ataRowState.Add ed) Is Nothing Then
hasChanges=tru e
If Not dt.GetChanges(D ataRowState.Mod ified) Is Nothing Then
hasChanges=tru e
If Not dt.GetChanges(D ataRowState.Del eted) Is Nothing Then
hasChanges=tru e
Next

On some (not all) of my datatables in the dataset, Visual Studio is
claming that certain columns do not exist when I hit the first
dt.getchange s line. The column that it claimes does not exist are not in
the datatable (according to the dataset visualiser)
I have tried regenerating my dataset.

Does anyone know what could be going on? :( I cant figure it out...
Thank you
John
Jun 27 '08 #3
Hi Cor,

There are empty columns, but there are also empty columns in datatables that
work....that is, I cant see that they directly relate.

I don't know why, but if I do a merge into a clean dataset beforehand it
works.

It's threaded code and the original dataset comes from a baseform. These
things shouldnt really matter I dont think but maybe that has something to
do with it.For now I'm content to use the workaround below.

'This worked
Dim test As New dsBMS

test.Merge(myDs )
For Each dt As DataTable In test.Tables
If Not dt.GetChanges(D ataRowState.Add ed) Is Nothing Then hasChanges=true
If Not dt.GetChanges(D ataRowState.Mod ified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(D ataRowState.Del eted) Is Nothing Then
hasChanges=true
Next

'This didnt work
For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(D ataRowState.Add ed) Is Nothing Then hasChanges=true
If Not dt.GetChanges(D ataRowState.Mod ified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(D ataRowState.Del eted) Is Nothing Then
hasChanges=true
Next

Thanks Cor
John
"Cor Ligthert[MVP]" <no************ @planet.nlwrote in message
news:B2******** *************** ***********@mic rosoft.com...
John,

This sound strange

On some (not all) of my datatables in the dataset, Visual Studio is
claming
that certain columns do not exist when I hit the first dt.getchanges line.
The column that it claimes does not exist are not in the datatable
(according to the dataset visualiser)

The GetChanges creates a real copy of your datatable, I have never seen
this, maybe it uses XML serializing behind the scene and then avoid
probably empty columns, can you check that? Would be interesting.

Cor
"John Sheppard" <sp**@nospam.co mschreef in bericht
news:g2******** *@news2.newsguy .com...
>Hello there,

I have the following code; I do this as a work around for a
dataset.hascha nges method which doesnt appear to work correctly either

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(D ataRowState.Add ed) Is Nothing Then
hasChanges=tru e
If Not dt.GetChanges(D ataRowState.Mod ified) Is Nothing Then
hasChanges=tru e
If Not dt.GetChanges(D ataRowState.Del eted) Is Nothing Then
hasChanges=tru e
Next

On some (not all) of my datatables in the dataset, Visual Studio is
claming that certain columns do not exist when I hit the first
dt.getchange s line. The column that it claimes does not exist are not in
the datatable (according to the dataset visualiser)
I have tried regenerating my dataset.

Does anyone know what could be going on? :( I cant figure it out...
Thank you
John


Jun 27 '08 #4

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

Similar topics

2
5264
by: Niyazi | last post by:
Hi, I have not understand the problem. Before all the coding with few application everything worked perfectly. Now I am developing Cheque Writing application and when the cheque is clear the user have to open a form and entera date so we know in report that the desiered check has been cleared. It takes me while to wrtie. But when I try to update the datagrid changes via dataset to MS Access 2003 I get an error that simply says...
12
1997
by: Graham Blandford | last post by:
Hi all, Would someone be able to tell me the most 'graceful' way of removing unwanted rows from a dataset based on a condition prior to update? OR, resetting the rows all to unchanged after they are initally added to the recordset. I create a dataset, which begins empty after the initial .Fill. Then I create several rows with some default information, leaving one
3
2748
by: AH | last post by:
Hi all, I noticed this strange behavior; I created a new control (example inherits from textbox) and add a new property, then I bind this new property to a field in my dataTable in a dataSet. After the binding statement, when I check for dataset.getchanges ... it alway returns that there is changes (even the propety just set the value and get the same value to return)... I have tried to understand what has changed by using the...
4
1851
by: Peter Proost | last post by:
Hello group, what would be the best way to do the next thing: I've got a grid form with about 15000 records, when I double click a row a detail form is opened and the user can modify and save the record, this all works just fine, then the user closes the detail form and ofcourse I want to show his modifications in the grid form, but now my question is what's the best way to do this without completely reloading the dataset that holds the...
7
3359
by: Jean Christophe Avard | last post by:
Hi! I have a dataset that retreive all the item information from the database. I need to be able to edit them, in the dataset and in the database. I have this code, could anyone tell me if I'm in the good way, cause I build that code from a book example, but nothing works. I HAVE THIS CODE TO SAVE THE CHANGE OF THE DATASET dstPlant.Tables("plant").Rows(intEditRow)("latin_name") = "KLHJJKJKJKHHHHHH"
4
2249
by: Al | last post by:
I have this scenario: 1. XML file with schema and data is created from SQL Server tables. XML file contains 6 tables, some of them have rows, some of them are empty. 2. XML file is given to the person with Pocket PC. 3. XML file is used to populate DataSet on the Pocket PC. 4. User adds new rows, changes values, deletes some rows. 5. Altered dataset is saved back to XML file. 6. XML file is given back to the person who initially created...
1
2534
by: matt | last post by:
hello, i have a web app that allows users to query our oracle db and produce a dataset of report data. they then have the option to serialize this data and store it in the database. later, then can re-run the report and get fresh data. now, they would like to be able to compare the fresh data to the stored data, getting a break-down of added/deleted/changed rows. on the surface, this sounded plausible -- by deserializing the stored
5
16705
by: Mark Chambers | last post by:
Hi there, Can anyone explain the following (very) simple scenario. 1) I make an exact copy of my "DataSet" and delete one record from a given table (in the copy) 2) I invoke "DataSet.GetChanges()" on the above copy and pass the results to "DataSet.Merge()" on the original copy 3) If I now inspect the original copy, it shows that the record has *not* been deleted from the table. However, a call to "GetChanges()" does show my
0
1244
by: Jim | last post by:
Hi, ..Net 2003, Language: VB Problem: Populating a Dataset with a datatable, the columns of which are bound to controls on a form. I'm assigning the value directly in 2 of the fields of the datatable because they don't relate to controls in UI. When I try to save the data I'm using the DataSet.GetChanges(DataRowState.Added) function to return a new dataset containing newly added row(s). Subsequently I'd take the changed data and...
0
8703
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
8623
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,...
1
8935
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
8893
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...
0
5879
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
4389
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...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3069
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
2359
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.