NEWSEQUENTIALID() issue

Posts   
 
    
LLBLGen
User
Posts: 43
Joined: 10-Apr-2006
# Posted on: 16-Aug-2006 19:15:07   

I have a view Book which is view from BookRoot table..somthing like this ... create view Book as select * from BookRoot ... BookRoot table has BookGUID (PK) which has the default value of NEWSEQUENTIALID()

In my project i have used Book (view) to do my things... when i do

BookEntity NewBook=new BookEntity (); MessageBox.Show(BookGUID.ToString() );

i get 000-000-0000... how would i get the SEQUENTIAL Guid?

i do have my <add key="SqlServerDQECompatibilityLevel" value="2" /> in my config file.

I am using Adapter/WinForms/ .Net 2.0/ SQLServer 2005

Thanks

JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 16-Aug-2006 19:44:43   

You won't get it until after you save it with refetch using your code.

The database doesn't know you created a new BookEntity until you try to insert it.