New Entity Problem with PK

Posts   
 
    
chrisa23
User
Posts: 12
Joined: 04-Apr-2006
# Posted on: 13-Sep-2006 17:42:09   

I am trying to create a new entity where the user can choose the integer key. (self servicing/sql)

I have never had a problem like this before, and I'm sure I've used non-Identity keys before...

When I try to save the entity I get a cannot insert NULL into EmployeeId...

I can trace the code in debug and see that the entity has both an EmployeeId value and IsNew is true....

The problem is in the Query Executed, but I am clueless why it is doing this:

Query: INSERT INTO [InfoVine].[dbo].[Employee] ([FirstName], [LastName], [Admin], [Active], [JobTracking])  VALUES (@FirstName, @LastName, @Admin, @Active, @JobTracking);**SELECT @EmployeeId=SCOPE_IDENTITY()
Parameter: @EmployeeId : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Output. Value: <undefined value>.**
Parameter: @FirstName : AnsiString. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "Chris".
Parameter: @LastName : AnsiString. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "Anderson".
Parameter: @Admin : Boolean. Length: 0. Precision: 1. Scale: 0. Direction: Input. Value: True.
Parameter: @Active : Boolean. Length: 0. Precision: 1. Scale: 0. Direction: Input. Value: True.
Parameter: @JobTracking : Boolean. Length: 0. Precision: 1. Scale: 0. Direction: Input. Value: True.

I am trying to finish up a project, and this is just the last Admin bit... Please help!

chrisa23
User
Posts: 12
Joined: 04-Apr-2006
# Posted on: 13-Sep-2006 18:55:41   

Figured it out. I had previously changed from an Indentity field, and LLBL gen didn't update the property in the entity. One check box changed re-gen and bingo bango back in business...