guid

How deterministic Are .Net GUIDs ?

Yesterday I asked Are GUIDs generated on Windows 2003 safe to use as session IDs? and the answer combined with combined with this article GUIDs are globally unique, but substrings of GUIDs aren't prompted me to think about replacing my current mechanism of using GUIDs as session ID's in cookies. Because it's a bit of work to make that c...

Find GUID in database

I am currently working on a project where some (significant) data corruption has occurred. Specifically the database is using GUIDs as primary keys on most tables, however it is not enforcing data integrity between those tables (due to a long-winded "this was bought from another company and integrated with our stuff" discussion). There...

C# guid and SQL uniqueidentifier

I want to create a GUID and store it in the DB. In C# a guid can be created using Guid.NewGuid(). This creates a 128 bit integer. SQL Server has a uniqueidentifier column which holds a huge hexidecimal number. Is there a good/preferred way to make C# and SQL Server guids play well together? (i.e. create a guid using Guid.New() and ...

C#: static Guid as argument of an attribute

How can I use a static Guid as argument in an attribute? static class X { public static readonly Guid XyId = new Guid("---"); } [MyAttribute(X.XyId)] // does not work public class myClass { } It does not work because Guid must be readonly, it can not be const. The string and byte[] representation would also be readonly. Is there a...

UUID in OpenOffice.org Base

How would one go about using a UUID as a primary key in an OpenOffice.org Base database? I have a need to gather data on multiple, unnetworked PCs that I can't install software on (I am using OpenOffice.org Portable). After gathering data, it will be merged into a single database. I believe that a UUID/GUID is the ideal solution, but f...

How should I create my GUID?

I'm going to be uploading images to a system and need them to be referenced by a non-sequential unique ID. I've read a little about GUIDs, and I'm wondering what the best approach to making one in PHP is. Should I md5() the current timestamp and salt it, or will PHP's uniqueid (http://www.php.net/manual/en/function.uniqid.php) function b...

Using a System.Guid as primary key in ASP.Net MVC?

I have created a table in the database that has a System.Guid as it's primary key. The required ADO.Net Entity Framework model has been generated and the required stored procedures has been mapped. I created a new controller and added the basic required code for Create and Edit for the data. However when the clicking on the link to edit...

setting UniqueIdentifier from Guid in LINQ, Null Reference exception

I am trying to set a unique identifier in my customer table from the unique identifer from my membership table (asp.net membership). However I am getting a null reference exception when doing so. This is the code. Customer customer = db.Customers.SingleOrDefault(c => c.Id == Convert.ToInt32(formValues["CustomerId"])); Guid userId = ...

Select DataTable row, filtered by GUID

I have a non-primary-key column with GUID's (with DataType System.Guid) and it appears you cant use DataTable.Select on that column. (Only DataRowCollection.Find but it requires GUID to be Primary Key column, which is not my case) Anyway, I need to get that row WHERE UniqueId = *GUID* Maybe there are some LINQ tricks that can do the jo...

Thread safety of UuidCreateSequential and p/invoke calls in general

I am working with a system that uses GUIDs as keys in most database tables. The guids are created using UuidCreateSequential, in order to be nice to the database indexes. C++ syntax, according to http://msdn.microsoft.com/en-us/library/aa379322%28VS.85%29.aspx : RPC_STATUS RPC_ENTRY UuidCreateSequential( UUID __RPC_FAR *Uuid ); p...

SQL Server - SCOPE_IDENTITY() for GUIDs?

Can anyone tell me if there is an equivalent of SCOPE_IDENTITY() when using GUIDs as a primary key in SQL Server? I don't want to create the GUID first and save as a variable as we're using sequential GUIDs as our primary keys. Any idea on what the best way to retrieve the last inserted GUID primary key. Thanks in advance! ...

guid generator in ruby

How do I generate a globally unique ID in ruby (without rails/merb)? ...

get a guid of an list item of a sharepoint list

Im using SPDataSource to bind a sharepoint list to a repeater control within the itemtemplate of the repeater i am using things such as <%# Eval("Title") %> im trying to get an id for the list item, ideally something like a guid eg <%# Eval("GUID") %> but the above does not work... how can i get a guid? btw i did <%# Eval("ID") %> th...

(.NET) Easy way to generate random, easy to remember passcodes

I have a project in the works, and I'll need to associate a passcode with an item. The password should be completely non sequential or easily guessable, yet simple to remember. I thought about doing something like this. string rand = System.Guid.NewGuid().ToString(); rand.Substring(0,3); Return the first 4 digits of a GUID. I was wo...

SQL Server how to maintain GUID across tables in same DB

I want to create a DB , where each table's PK will be GUID and which will be unique across the DB, Example: my DB name is 'LOCATION'. And I have 3 table as 'CITY' , 'STATE' and 'COUNTRY'. I want that all the 3 tables have same PK field as GUID ,and that value will be unique across DB. How to do this in SQL Server, any idea? I have n...

Why does Create GUID display different GUID parts with different capitalization?

Visual Studio is shipped with a Create GUID tool that is used for generating GUIDs. Now here's a GUID it generated for me: {7A09BF85-9E98-44ea-9AB5-A13953E88C3D} each of the 4 GUID parts contains both letters and digits. Why does the third part contain only lowercase letters and other only upcase letters? Is there any sence behind tha...

Are visible GUIDs a security risk?

Hi, I'm using ASP.NET and the membership provider for my site. If the user is able to easily see their GUID, would that be considered a security risk? Should I take extra steps to prevent users from easily finding their GUID such as when they confirm their verification process. Although there are ways around this, such as using a seper...

Where can I find a list of well known COM object GUIDS.

I was trying to get some unit tests to work when I got an error similar to: Retrieving the COM class factory for component with CLSID {BA3D0120-E617-4F66-ADCA-585CC2FB86DB} failed due to the following error: 80040154 The resolution was to install Blackberry Desktop manager, and it was simple to intuitively figure it out becaus...

Increase increment size to match GUID advantage

Hi, I've been thinking of implementing this system, but can't help but feel there's a catch somewhere. One of the points of using GUID over incrementing int is that, in the future, if you were to merge databases together, you wouldn't have any clashes over the primary key/identifier. However, my approach is to set the increment size t...

Generating a new Random GUID in the Delphi IDE

How I can generate a random new GUID inside of the Dephi IDE? I am using Delphi 2007. ...