473,385 Members | 1,373 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,385 software developers and data experts.

GetChanges gives null column value in error

Using VB 2005, I have a strongly typed dataset (from a .xsd file in my
project).

When I load data into this dataset, the immediate window shows:
?ds.TableX(0).IstheFieldNull
True

So, dutifully, I give it a value:
ds.TableX(0).theField = "testabc123"

I can look in the immediate window and see:
?ds.TableX(0).IstheFieldNull
False
?ds.TableX(0).theField
"testabc123"

However, I can also see:
?CType(ds.GetChanges, dsObjectType).TableX(0).IstheFieldNull
True

Clearly, GetChanges() recognized the TableX(0) row was modified, but it
failed to include my column value. Furthermore, if I:
ds.writexml("c:\ds.xml")
ds.GetChanges().WriteXML("c:\dschanges.xml")

I see that the row of interest is in the XML, but the column is
actually missing (ie null).

Anyone have any ideas?

Kerry

Feb 22 '06 #1
1 1438
Just to ask the obviously basic, did you BeginEdit and EndEdit the row?
GetChanges should reflect the modified values and no the original values.

CType(ds.GetChanges, dsObjectType).TableX(0).IstheFieldNull, will not
necessarily be the row you think it is, as this is a subset of your original
table.

try this

if ds.TableX.rows(0).IstheFieldNull then
ds.TableX.rows(0).beginedit
ds.TableX.rows(0)("TheField") = "SomeValue"
ds.TableX.rows(0).endedit
debug.writeline(ds.TableX.rows(0).rowstate)
end if


<kc********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Using VB 2005, I have a strongly typed dataset (from a .xsd file in my
project).

When I load data into this dataset, the immediate window shows:
?ds.TableX(0).IstheFieldNull
True

So, dutifully, I give it a value:
ds.TableX(0).theField = "testabc123"

I can look in the immediate window and see:
?ds.TableX(0).IstheFieldNull
False
?ds.TableX(0).theField
"testabc123"

However, I can also see:
?CType(ds.GetChanges, dsObjectType).TableX(0).IstheFieldNull
True

Clearly, GetChanges() recognized the TableX(0) row was modified, but it
failed to include my column value. Furthermore, if I:
ds.writexml("c:\ds.xml")
ds.GetChanges().WriteXML("c:\dschanges.xml")

I see that the row of interest is in the XML, but the column is
actually missing (ie null).

Anyone have any ideas?

Kerry

Feb 22 '06 #2

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

Similar topics

26
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
5
by: S.Patten | last post by:
Hi, I have a problem with updating a datetime column, When I try to change the Column from VB I get "Incorrect syntax near '942'" returned from '942' is the unique key column value ...
7
by: Douglas Buchanan | last post by:
I cannot access certain column values of a list box using code. I have a list box 'lstPrv' populated by the query below. SELECT tblPrv.fkPrvID, lkpCat.CatNm, lkpSrv.SrvNm, lkpCat.pkCatID,...
5
by: tshad | last post by:
I have the following code: *************************************************************************** Dim CommandText as String = "INSERT INTO ftsolutions.dbo.position (client,dateposted) VALUES...
8
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&...
4
by: George | last post by:
Got a question about the side effect of DataAdapter.Update() and DataTable.GetChanges(). Say I set up a DataTable and a DataAdapter in a class. Delete (Not remove) a row in the data table and...
9
by: Martin Arvidsson | last post by:
Hi! I have two computed datafields that i am displaying in my windowsform. When i try to update the dataset and commit the transaction. I get an error message telling me that i cant update...
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...
3
by: John Sheppard | last post by:
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.