Search   

Sunday, February 05, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  IdGenerationEve...
 IdGenerationEvent
 
 1/29/2007 4:15:59 PM
FalkW
6 posts


IdGenerationEvent
Hi, How can using the IdGenerationEvent with the Sql Server? I need a unique Id for the complete DataBase. I like the Id as a Int32. Best Regards Falk
 2/2/2007 11:18:39 AM
Mirko
109 posts
5th


Re: IdGenerationEvent

Hi Falk,

my every-day sermon is to use Guids as primary keys. 

Having said that, you simply add a handler to the IdGenerationEvent and use ADO.NET to fetch a unique integer value from the database each time you need one. You might use a special table having only an autoincremented primary key column. If you insert a new row into this table you get back a new id. I recommend to set the autoincrement value to 10-100 to avoid roundtrips for each and every object you create. Fetch a new id and use the next 10 or 100 values starting from the new id.

I hope that helps.

Best Regards:
Mirko

 

  NDO-Forum postings in english please, if possible.  Developing with NDO  IdGenerationEve...
  SearchSearch  Forum HomeForum Home