473,394 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Weird dataset.getchanges problem

Hello there,

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

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(DataRowState.Added) Is Nothing Then hasChanges=true
If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Deleted) 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 2308
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.comschreef in bericht
news:g2*********@news2.newsguy.com...
Hello there,

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

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(DataRowState.Added) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Deleted) 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**********************************@microsof t.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.comschreef in bericht
news:g2*********@news2.newsguy.com...
>Hello there,

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

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(DataRowState.Added) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Deleted) 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 #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(DataRowState.Added) Is Nothing Then hasChanges=true
If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then
hasChanges=true
Next

'This didnt work
For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(DataRowState.Added) Is Nothing Then hasChanges=true
If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Deleted) Is Nothing Then
hasChanges=true
Next

Thanks Cor
John
"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:B2**********************************@microsof t.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.comschreef in bericht
news:g2*********@news2.newsguy.com...
>Hello there,

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

For Each dt As DataTable In myDs.Tables
If Not dt.GetChanges(DataRowState.Added) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Modified) Is Nothing Then
hasChanges=true
If Not dt.GetChanges(DataRowState.Deleted) 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 #4

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

Similar topics

2
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...
12
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...
3
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....
4
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...
7
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...
4
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...
1
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...
5
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.