Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting primary key after an insert
Message
From
22/06/2006 11:17:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/06/2006 11:12:20
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01127217
Message ID:
01130834
Views:
16
>>>>>Don't auto-generate the keys, I don't know if someone's already mentioned this but use Guids in .Net.
>>>>>
>>>>>ie: (c#)
>>>>>
>>>>>
>>>>>Guid id = Guid.NewGuid();
>>>>>
>>>>>
>>>>>Auto-incrementing keys is a bad idea, your guids will be unique and you'll have the primary key to hand at all times.
>>>>
>>>>I don't have any problem with that at all. Everything is done at the framework level so there is no code to manage that at the client's applicatioan.
>>>
>>>I'm not sure what you mean, didn't you have a requirement to know the primary key of the record you just created?
>>>
>>>Kev
>>
>>No because with a Guid key you already know it before committing to backend (and might never commit if you wish)
>
>The subject says "getting primary key after insert", all I was saying is that if the PK is generated by the caller you wouldn't need to get the PK back from the command.
>
>Now I'm totally confused lol - I haven't had enough coffee today, clearly ;-)
>
>Kev

ROFL. With all those gt signs it looks like I missed it completely and I was defending your idea against you:) Great.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform