Home All Groups Group Topic Archive Search About
Author
3 Oct 2006 5:18 PM
Roy
Is there an equivalent class function in .NET to generate sequencial guid
just like the NewSequentialID() function in SQL Server 2005?

Author
3 Oct 2006 5:34 PM
Michael Nemtsev
Hello Roy,

Guid g = Guid.NewGuid();

R> Is there an equivalent class function in .NET to generate sequencial
R> guid just like the NewSequentialID() function in SQL Server 2005?
R>
---
WBR,
Michael  Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Author
3 Oct 2006 6:25 PM
Roy
Is Guid.NewGuid() going to generate sequencial guid? I think it is random guid.

Show quote
"Michael Nemtsev" wrote:

> Hello Roy,
>
> Guid g = Guid.NewGuid();
>
> R> Is there an equivalent class function in .NET to generate sequencial
> R> guid just like the NewSequentialID() function in SQL Server 2005?
> R>
> ---
> WBR,
> Michael  Nemtsev :: blog: http://spaces.live.com/laflour
>
> "At times one remains faithful to a cause only because its opponents do not
> cease to be insipid." (c) Friedrich Nietzsche
>
>
>
Author
3 Oct 2006 6:40 PM
Michael Nemtsev
Hello Roy,

Ahh, missed it.
Guid can't be generated sequential
only random

R> Is Guid.NewGuid() going to generate sequencial guid? I think it is
R> random guid.
R>
Show quote
R> "Michael Nemtsev" wrote:
R>
>> Hello Roy,
>>
>> Guid g = Guid.NewGuid();
>>
>> R> Is there an equivalent class function in .NET to generate
>> sequencial
>> R> guid just like the NewSequentialID() function in SQL Server 2005?
>> R>
>> ---
>> WBR,
>> Michael  Nemtsev :: blog: http://spaces.live.com/laflour
>> "At times one remains faithful to a cause only because its opponents
>> do not cease to be insipid." (c) Friedrich Nietzsche
>>
---
WBR,
Michael  Nemtsev :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Author
3 Oct 2006 6:56 PM
sloan
Post was answered in

microsoft.public.dotnet.languages.csharp







Show quote
"Roy" <R**@discussions.microsoft.com> wrote in message
news:26B435F9-B3CF-4E63-84B0-DB9380FFEB0C@microsoft.com...
> Is there an equivalent class function in .NET to generate sequencial guid
> just like the NewSequentialID() function in SQL Server 2005?
Author
3 Oct 2006 8:41 PM
Cowboy (Gregory A. Beamer)
Here is the comb algorithm (have not tested this implementation, just found
on web):


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
Show quote
"Roy" <R**@discussions.microsoft.com> wrote in message
news:26B435F9-B3CF-4E63-84B0-DB9380FFEB0C@microsoft.com...
> Is there an equivalent class function in .NET to generate sequencial guid
> just like the NewSequentialID() function in SQL Server 2005?
Author
3 Oct 2006 8:42 PM
Cowboy (Gregory A. Beamer)
Accidental enter key press:

Here is comb
public static Guid NewComb()
{
byte[] dateBytes = BitConverter.GetBytes(DateTime.Now.Ticks);
byte[] guidBytes = Guid.NewGuid().ToByteArray();
// copy the last six bytes from the date to the last six bytes of the GUID
Array.Copy(dateBytes, dateBytes.Length - 7, guidBytes, guidBytes.Length - 7,
6);
return new Guid(guidBytes);
}

Look up COMB GUID on google if you need more.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
Show quote
"Roy" <R**@discussions.microsoft.com> wrote in message
news:26B435F9-B3CF-4E63-84B0-DB9380FFEB0C@microsoft.com...
> Is there an equivalent class function in .NET to generate sequencial guid
> just like the NewSequentialID() function in SQL Server 2005?

AddThis Social Bookmark Button