473,671 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cloning a dataset row OR are rows allowed to be orphans?

Please forgive me if this is not the best group for this problem. I
frequently have difficulty figuring out which group to post in. (And got
slapped down once when I postied in the wrong group:-( dotnet.general sounds
like a good place to get started.

I 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.cl one or data.datarow.co py NOR a way of
creating the row in the absense of the table.

Can rows have existence independent of a table?
Here is what I have resorted to doing:
Public Property Shock() As Global.SimUser. dsShock.ShockRo w
Get
Return Me.m_shockTable .Rows(0)
End Get
Set(ByVal value As Global.SimUser. dsShock.ShockRo w)
Me.m_shockTable .Clear()
Me.m_shockTable .ImportRow(valu e)
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.ShockRo w
Get
Return Me.m_shock End Get
Set(ByVal value As Global.SimUser. dsShock.ShockRo w)
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
Nov 4 '05 #1
1 2450
Al,
Please forgive me if this is not the best group for this problem. I
frequently have difficulty figuring out which group to post in. (And got
slapped down once when I postied in the wrong group:-( dotnet.general
sounds
like a good place to get started.


Right, however *better* for this kind of question *next time* is probably

microsoft.publi c.dotnet.framew ork.adonet.

For copying indepent rows is the method

Datatable.impor trow

http://msdn.microsoft.com/library/de...rtrowtopic.asp

For complete tables just datatable.copy

I hope this helps,

Cor
Nov 4 '05 #2

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

Similar topics

3
1265
by: dotNetDave | last post by:
I have some xml that I am loading into a DataSet. Later in my program I have to clone that DataSet but I keep getting an error saying that I can't have a table named the same as my DataSet?!? If I look at the original DataSet it's is named "MEDIA" and there is a table in it called "media". If you can't have a table named the same as the DataSet then why is this happening in the original xml DataSet? I really need to clone this DataSet...
7
2710
by: sonic | last post by:
Hello, I am cloning a table row which contains images that have behaviors attached to them as well as onclick events. The problem is that the cloned row seems to be executing the behavior/events on the original rows image. I overwrote the onclick as well as attached a behavior to the image in cloned row, but events such as onmouseover execute now on both images when the duplicate is mouse overed.
3
3616
by: Dmitry Karneev | last post by:
Hi! I have a rather interesting problem. I have a dataset that contatin data from database. I need to clone this dataset with data but all id's in tables must be NULL and all DataRowStates must be Added because I want to make some changes to dataset and then insert it to database as new records. How can I do it? Thanks in advance,
3
1527
by: MajorTom | last post by:
Hello everybody, I need help on how to use the same datase in two different form, this is the scenario: at the first form I load a big dataset (ds1) for short, but I not want to load it again at the second form at some point I use a second form Form f = new FormX(); f.ShowDialog();
1
2285
by: imakowski | last post by:
Is there posibility to create clone of an object without using serialization, create instance and copy, reflection ? I have a problem with DataColumnColection which is member of DataTable (Columns - property). I found that constructor of Typed DataSet with Typed DataTable takes long time :/ I tried to investigate this problem and found that adding columns to Columns (even if I use AddRange) (typeof DataColumnCollection) is very slow...
1
333
by: Al Christoph | last post by:
Please forgive me if this is not the best group for this problem. I frequently have difficulty figuring out which group to post in. (And got slapped down once when I postied in the wrong group:-( dotnet.general sounds like a good place to get started. I 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...
3
1371
by: P K | last post by:
Hi, I have 3 datasets d1Main is the main dataset having rows. I loop through rows in d1main and any row failing validations is moved to d2Bad dataset. I had to clone d2bad as d1main and then add failed row to d2bad so d2bad is created out of d1main.
0
1272
by: Liming | last post by:
Hi, I designed a few DataSet Tables in the typed dataset dsigner. Recently, I encountered an error saying Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. I didn't have any relations or non null values in the table, so I didn't know what was going on. I debugged by manually query the same
0
8388
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8593
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7423
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5687
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2046
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1799
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.