StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
WinForms (How do I?)
»
CopyDataFrom
CopyDataFrom
Post Reply
Like
0
CopyDataFrom
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Ian Hammond
Ian Hammond
posted 14 Years Ago
ANSWER
Topic Details
Share Topic
Group: Forum Members
Posts: 57,
Visits: 277
I wish to make a copy of some data by loading the original, changing the name of a queue that it belongs to and writing it back to the BO but preserving the original data. When I look at the individual rows, the data is changed, but nothing seems to be saved into the backend database. Have I misinterpreted the use of CopyDataFrom: Please see attached code snippet
Many thanks for any assistance.
this
.localPrintQBO.FillWithQueueItems(
Global
.CurrentUserId,
Global
.CurrentTableId,
this
._currentPrintQ);
DataTable
loTable =
new
DataTable
();
loTable =
this
.localPrintQBO.CurrentDataTable.Clone();
foreach
(
DataRow
qRow
in
this
.localPrintQBO.CurrentDataTable.Rows)
{
loTable.ImportRow(qRow);
}
//Change the copy to the target print queue
foreach
(
DataRow
qRow
in
loTable.Rows)
{
qRow[
"QName"
] =
this
.cboTargetQ.Text.ToString();
}
this
.localPrintQBO.CopyDataFrom(loTable,
BusinessCloneDataType
.AppendDataToTableFromCompleteTable);
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
CopyDataFrom
Ian Hammond
-
14 Years Ago
I'm not quite sure I follow what you are trying to do. Does the...
Greg McGuffey
-
14 Years Ago
Hi Ian, I believe the problem is that the BO.CopyDataFrom() method...
Edhy Rijo
-
14 Years Ago
Setting the QName via the BO should dirty it as well.
Greg McGuffey
-
14 Years Ago
Thanks Guys for your input. I liked the different slant on the code...
Ian Hammond
-
14 Years Ago
If you are copying data, are you copying it into the same BO? I mean,...
Charles R Hankey
-
14 Years Ago
Yep, Charles' approach would definately be the cleanest for this...
Dustin Taylor
-
14 Years Ago
Many thanks, guys, that works a treat. Regards
Ian Hammond
-
14 Years Ago
Post Reply
Like
0
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search