Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
when a user wants to add a new patient to the database, i want to autogenerate a primary key to identify the patient. how do i autogenerate this in c#, so that i know it wont clash with any records already in the database?
Posted

In VB.NET, I would used the GUID... I don't know what the C# equivalent is but this is what it looks like in VB.NET:

 

Dim PKey as GUID

 

PKey = PKey.newguid()

Laredo512

* using VS.NET Pro 2003 *

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...