The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

Using IDENTITY_INSERT?

Last post 04-13-2008, 4:56 AM by David.Parsons. 1 replies.
Sort Posts: Previous Next
  •  04-12-2008, 9:58 PM 8825

    Using IDENTITY_INSERT?

    Is there a way to insert a value into an id column, similarly to what I would do if i was using SET IDENTITY_INSERT ON in a stored procedure? I've tried the standard:

    Code:
    var person = new Person();
    person.AddNew();
    person.id = 250;
    person.name = "Bob Smith";
    person.Save();

    But when i do this, it creates its own identity, rather than using the one i gave it.

  •  04-13-2008, 4:56 AM 8830 in reply to 8825

    Re: Using IDENTITY_INSERT?

    No, out-of-the-box, EntitySpaces does not allow setting identity PKs. But, you an create your own SP, add a method to call it in your custom class, then use that in your code, instead of Save().


    David Neal Parsons
    www.entityspaces.net
View as RSS news feed in XML