Experience members,
I know this question has been asked before. (I know I search for 3 hours) But time to ask again.
I am trying to copy a entity and it is not going very well for me. I have tried many of the methods that I found when I searched the forum, but nothing works and I get many different errors with each method.
MSSQL 2000
VB.NET 2003
LLBLGenPro 1.0.2003.1
The method I would like to use is below. - Produces errors on some date columns that I have in the table. I also read in the post that this will not produce a deep clone, but I added Customer.isDirty = True and then I get error on PK on related table when doing the customer save. You will also see that this table as many FK to other tables (status_id, vendor_id, ect....).
CREATE TABLE [dbo].[Design] (
[Design_ID] [int] IDENTITY (1, 1) NOT NULL ,
[Created] [datetime] NOT NULL ,
[Enabled] [bit] NULL ,
[Wave_ID] [int] NULL ,
[StatusCode_ID] [int] NULL ,
[DisabledDate] [datetime] NULL ,
[DesignNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Description] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[PriceGoal] [float] NULL ,
[Vendor_ID] [int] NULL ,
[PackLocation_ID] [int] NULL ,
[DesignClass_ID] [int] NULL ,
[DesignType_ID] [int] NULL ,
[QTYShowSamples] [float] NULL ,
[QTYSalesSamples] [float] NULL ,
[QTYPOGSamples] [float] NULL ,
[QTYCLRSamples] [float] NULL ,
[RetailPrice] [float] NULL ,
[PriceQuote] [float] NULL ,
[PriceQuote2] [float] NULL ,
[QTYOrderEstimate] [float] NULL ,
[VendorItemNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CancelDate] [datetime] NULL ,
[Group_ID] [int] NULL ,
[Cancellor] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Last_Wave_Before] [int] NULL ,
[KitNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CasePack] [float] NULL ,
[QuoteQTY] [float] NULL ,
[QuoteQTY2] [float] NULL ,
[CandyFill] [varbinary] (50) NULL ,
[Account_ID] [int] NULL
) ON [PRIMARY]
GO
Design.isNew = True
for I as Integer = 0 to Design.Fields.Count -1
Design.Fields(I).isChanged = True
Next
Design.Save
Not exactly sure what is going on, can someone push me though this block?
Thanks,
Chris Smith