PC Review


Reply
Thread Tools Rate Thread

Datarows without datatables ?????

 
 
=?Utf-8?B?QWwgQ2hyaXN0b3Bo?=
Guest
Posts: n/a
 
      5th Nov 2005
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
 
Reply With Quote
 
 
 
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      5th Nov 2005
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


 
Reply With Quote
 
Sahil Malik [MVP]
Guest
Posts: n/a
 
      5th Nov 2005
Since the structure of the row is dictated by the underlying columns in a
table - no it cannot exist completely independent of a datatable. The best
you can do is, use the DataTable.NewRow method to create a row with RowState
= Detached.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------

"Al Christoph" <(E-Mail Removed)> wrote in message
news:94FC3624-ABAF-45A8-A38A-(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?QWwgQ2hyaXN0b3Bo?=
Guest
Posts: n/a
 
      5th Nov 2005
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


"Sahil Malik [MVP]" wrote:

> Since the structure of the row is dictated by the underlying columns in a
> table - no it cannot exist completely independent of a datatable. The best
> you can do is, use the DataTable.NewRow method to create a row with RowState
> = Detached.
>
> - Sahil Malik [MVP]
> ADO.NET 2.0 book -
> http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
> ----------------------------------------------------------------------------
>
> "Al Christoph" <(E-Mail Removed)> wrote in message
> news:94FC3624-ABAF-45A8-A38A-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Sahil Malik [MVP]
Guest
Posts: n/a
 
      5th Nov 2005
You're welcome

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
----------------------------------------------------------------------------

"Al Christoph" <(E-Mail Removed)> wrote in message
news:C99D61BF-BA2A-4522-B977-(E-Mail Removed)...
> 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
>
>
> "Sahil Malik [MVP]" wrote:
>
>> Since the structure of the row is dictated by the underlying columns in a
>> table - no it cannot exist completely independent of a datatable. The
>> best
>> you can do is, use the DataTable.NewRow method to create a row with
>> RowState
>> = Detached.
>>
>> - Sahil Malik [MVP]
>> ADO.NET 2.0 book -
>> http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
>> ----------------------------------------------------------------------------
>>
>> "Al Christoph" <(E-Mail Removed)> wrote in message
>> news:94FC3624-ABAF-45A8-A38A-(E-Mail Removed)...
>> > 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

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare Datarows =?Utf-8?B?VG9jbw==?= Microsoft ADO .NET 2 25th Apr 2006 08:43 PM
What happens to datarows? Michael Jackson Microsoft Dot NET Framework 3 19th Aug 2005 08:33 PM
DataSet Merge Fails with no error set in datatables or datarows. ? =?Utf-8?B?cnlhbnVs?= Microsoft ADO .NET 3 1st Oct 2004 06:37 AM
adding datarows to tables and datatables to datasets psb Microsoft ASP .NET 1 1st Apr 2004 08:44 PM
How to copy DataRows between DataTables? Fabrício de Novaes Kucinskis Microsoft ADO .NET 5 3rd Jul 2003 12:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:54 AM.