Hi,
I am having trouble with an UpTo property and would appreciate some input.
EntitySpaces Version # 2008.0.0518.0
MyGeneration Version # 1.3.0.3
I have two different tables with UpTo. One table will always bring back nulls, the other works fine.
Code:
TRNJOpsDocAttribute _DocAttrib = new TRNJOpsDocAttribute();
if (_DocAttrib.LoadByPrimaryKey(1,378291,39,4))
{
//Always returns null
int? zx = _DocAttrib.UpToTRNJAttributeByItemId.AttributeId;
}
TRNJOpsDoc aa = new TRNJOpsDoc();
if (aa.LoadByPrimaryKey(1, 378291, 39))
{
//Returns 378291
int? zy = aa.UpToTRNJOpsItemBySourceId.ItemId;
}
Here are the table creates for the tables that return null. I have only inluded the ones that do not work. Let me know if I need to post the scripts for the good tables as well.
Code:
CREATE TABLE [dbo].[TRNJ_DocAttribute](
[LookupId] [int] NOT NULL,
[QuestionOrder] [int] NOT NULL,
[AttributeId] [int] NOT NULL,
CONSTRAINT [PK_TRNJ_DocAttribute] PRIMARY KEY CLUSTERED
(
[LookupId] ASC,
[QuestionOrder] ASC,
[AttributeId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
ALTER TABLE [dbo].[TRNJ_DocAttribute] WITH CHECK ADD CONSTRAINT [FK_TRNJ_DocAttribute_TRNJ_Attribute] FOREIGN KEY([AttributeId])
REFERENCES [dbo].[TRNJ_Attribute] ([AttributeId])
ALTER TABLE [dbo].[TRNJ_DocAttribute] CHECK CONSTRAINT [FK_TRNJ_DocAttribute_TRNJ_Attribute]
Code:
CREATE TABLE [dbo].[TRNJ_Attribute](
[AttributeId] [int] IDENTITY(1,1) NOT NULL,
[Attribute] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_TRNJ_Attribute_Attribute] DEFAULT (''),
[Question] [varchar](250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_TRNJ_Attribute_Question] DEFAULT (''),
CONSTRAINT [PK_TRNJ_Attribute] PRIMARY KEY CLUSTERED
(
[AttributeId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]