Datarows without datatables ?????

G

Guest

have the need for a data structure to have the clone / copy / independent
hunk of memory with the original values (take your choice) of a row in a
datatable. I don't see a data.datarow.clone or data.datarow.copy NOR a way of
creating the row in the absense of the table.

Can rows have existence independent of a table? The structure needs the data
from a specific row in a table. It needs to be able to modify that data, etc
without touching the original table. It only needs one row and not a table.
Hence my question:

Can a row have a life of its own without being in a table?????

Here is what I have resorted to doing:
Public Property Shock() As Global.SimUser.dsShock.ShockRow
Get
Return Me.m_shockTable.Rows(0)
End Get
Set(ByVal value As Global.SimUser.dsShock.ShockRow)
Me.m_shockTable.Clear()
Me.m_shockTable.ImportRow(value)
End Set
End Property

what I'd like to be able to do is

Here is what I have resorted to doing:
Public Property Shock() As Global.SimUser.dsShock.ShockRow
Get
Return Me.m_shock End Get
Set(ByVal value As Global.SimUser.dsShock.ShockRow)
Me.m_shock = value.clone
End Set
End Property

Regards,
Al Christoph
Senior Consultant and Proprietor
Three Bears Software, LLC
just right software @ just right prices @3bears.biz
 
C

Cor Ligthert [MVP]

Al,

A datarow cannot have an existence without a reference to a datatable (it
can be detached from it, however it keeps the reference). Probably the main
reason for that is, that the information about the items in a datarow is not
in the datarow, however in the columncollection from the datatable.

You can however clone a datatable and importdatarow s from the original and
you can copy a complete datatable.

I hope that this gives an idea.

Cor
 
G

Guest

That works perfectly for me! The row state of detached, that is. THANKS for
the response. It will simplify my code.

Regards,
Al Christoph
Senior Consultant and Proprietor
Three Bears Software, LLC
just right software @ just right prices @3bears.biz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top