|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sequential GuidIs there an equivalent class function in .NET to generate sequencial guid
just like the NewSequentialID() function in SQL Server 2005? 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 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 > > > 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: Michael Nemtsev :: blog: http://spaces.live.com/laflourR> >> 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, "At times one remains faithful to a cause only because its opponents do not cease to be insipid." (c) Friedrich Nietzsche 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? Here is the comb algorithm (have not tested this implementation, just found
on web): -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA http://gregorybeamer.spaces.live.com ************************************************* Think outside of the box! ************************************************* "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? 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. -- Show quoteGregory A. Beamer MVP; MCP: +I, SE, SD, DBA http://gregorybeamer.spaces.live.com ************************************************* Think outside of the box! ************************************************* "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? |
|||||||||||||||||||||||