|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
dt.reset() destroys independent datarow in memorydeclared datarow copied from a single datatable row. What is curious is that if a dataset is substituted for the datatable, the "independently" declared datarow is not destroyed. Is this difference in operation of datatable vs. dataset by design or a Microsoft error? Private drOriginal As DataRow 'independently declared datarow within same form Form paint function, where drOriginal is loaded: Public Sub FormPaint(ByVal intActivityID As Integer) Dim dt As New DataTable Dim dr As DataRow dt = dal.GetUserActivityRowWithActivityID(intActivityID) 'returns 1 row For Each dr In dt.Rows drOriginal = dr Next dt.Reset() 'subsequent processing reusing dt is not shown dt = Nothing End Sub When a subsequent event needs to use drOriginal, drOriginal is empty (a result of dt.Reset()) Again, if a dataset had been used instead of the datatable, drOriginal would be subsequently intact. Thanks, Dean Slindee Dean,
Dt.clear and DS.clear are for me as well not the most sure commands. I do mostly ds = new dataset to clear a dataset. dt = new datatable Cor Show quoteHide quote "Dean Slindee" <slin***@charter.net> schreef in bericht news:kZnag.34$hD5.32@fe04.lga... >I have noticed that doing a datatable.reset() wipes out an "independently" >declared datarow copied from a single datatable row. What is curious is >that if a dataset is substituted for the datatable, the "independently" >declared datarow is not destroyed. Is this difference in operation of >datatable vs. dataset by design or a Microsoft error? > > > Private drOriginal As DataRow 'independently declared datarow within > same form > > > Form paint function, where drOriginal is loaded: > > Public Sub FormPaint(ByVal intActivityID As Integer) > > Dim dt As New DataTable > > Dim dr As DataRow > > dt = dal.GetUserActivityRowWithActivityID(intActivityID) 'returns 1 > row > > For Each dr In dt.Rows > > drOriginal = dr > > Next > > dt.Reset() > > > 'subsequent processing reusing dt is not shown > > > dt = Nothing > > End Sub > > > When a subsequent event needs to use drOriginal, drOriginal is empty (a > result of dt.Reset()) > > Again, if a dataset had been used instead of the datatable, drOriginal > would be subsequently intact. > > > > Thanks, > > Dean Slindee > > > > > >
Frustrated trying to use "pure" VS.NET to access database properties
How Do I Put An End Of Line Character In A TextBox ADO.NET Error Export to excel without using office automation Detect if Themes are enabled? SQLConnection Setting focus Dynamically Create Timers are Run-Time VB Express - How to access query value on my form? VS2003 and VS2005 Side by Side |
|||||||||||||||||||||||