|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GetChanges gives null column value in errorproject). 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 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 <kcakebr***@gmail.com> wrote in message Show quoteHide quote news:1140620668.463613.111850@g44g2000cwa.googlegroups.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 >
Access member variable directly or through property within the class it is defined?
VB.net sleep problems Convert Words in Strings to Caps Help with ADODB.Command Error What does CRC error mean? Remote DNS Zone Creation with WMI and VB.NET VB2005 - Databound MaskedTextBox controls lose mask in MdiChild Forms. webbrowser control border check box data binding in VB.Net 2003 Is it possible to save a JPEG file as a Tif with specifically the JPEG compression in Vb.net? If yes |
|||||||||||||||||||||||