Results 1 to 3 of 3

Thread: how to generate sequence using vb.net express

  1. #1
    Join Date
    Mar 2009
    Posts
    27

    how to generate sequence using vb.net express

    I am using VB.net & trying to build a application for Office use & this Application is build for office information. I have created tables in it where every table has its on columns And are given the the primary key to each column. Now how can i create sequence in it....???

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Re: how to generate sequence using vb.net express

    Here is an example with reference to generate sequence in Letters. This may help you alot....!

    Code:
               char Letter = Char.Parse("A");
                int Count = 26;
                for (int i = 0; i < Count; i++)
                {
                        Response.Write(Letter);
                        Letter++;
                }
                Letter = Char.Parse("A");
                for (int i = 0; i < Count; i++)
                {
                    Response.Write("A"+Letter);
                    Letter++;
                }

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Re: how to generate sequence using vb.net express

    Here another example working with SQL Server with C#

    Code:
    private void Test()
    {
    SequentialGuid = new SequentialGuid(Guid.Empty);
    SequentialGuid++;
    }
    
    
    and C# code that increments GUIDs sequentially:
    
    public class SequentialGuid
    {
    Guid _CurrentGuid;
    public Guid CurrentGuid
    {
    get { return _CurrentGuid; }
    }
    
    public SequentialGuid()
    {
    _CurrentGuid = Guid.NewGuid();
    }
    
    public SequentialGuid(Guid previousGuid)
    {
    _CurrentGuid = previousGuid;
    }
    
    public static SequentialGuid operator ++(SequentialGuid sequentialGuid)
    {
    byte[] bytes = sequentialGuid._CurrentGuid.ToByteArray();
    for (int mapIndex = 0; mapIndex < 16; mapIndex++)
    {
    int bytesIndex = SqlOrderMap[mapIndex];
    bytes[bytesIndex]++;
    if (bytes[bytesIndex] != 0)
    {
    break;
    }
    }
    sequentialGuid._CurrentGuid = new Guid(bytes);
    return sequentialGuid;
    }
    
    private static int[] _SqlOrderMap = null;
    private static int[] SqlOrderMap
    {
    get
    {
    if (_SqlOrderMap == null)
    {
    _SqlOrderMap = new int[16] { 3, 2, 1, 0, 5, 4, 7, 6, 9, 8, 15, 14, 13, 12, 11, 10 };
    }
    return _SqlOrderMap;
    }
    }
    }

Similar Threads

  1. Import TGA sequence into Final Cut Pro
    By Vivan in forum Windows Software
    Replies: 6
    Last Post: 31-05-2010, 02:01 PM
  2. PCI Express 2.0 card in a PCI Express 1.0 slot?
    By Porfirioo in forum Monitor & Video Cards
    Replies: 7
    Last Post: 17-05-2010, 09:09 AM
  3. How to use the generate() in CPP
    By Gaelic in forum Software Development
    Replies: 5
    Last Post: 15-02-2010, 10:08 PM
  4. Don't know about Sequence Containers
    By Sonam Goenka in forum Software Development
    Replies: 5
    Last Post: 09-02-2010, 02:10 PM
  5. Usb pen drive sequence problem
    By niljaviya in forum Portable Devices
    Replies: 3
    Last Post: 16-03-2009, 06:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,958,745.15013 seconds with 17 queries