Results 1 to 3 of 3

Thread: [RESOLVED] Array from VB6 to VB.Net

  1. #1

    Thread Starter
    Addicted Member scsfdev's Avatar
    Join Date
    Feb 2008
    Location
    Singapore
    Posts
    224

    Resolved [RESOLVED] Array from VB6 to VB.Net

    Hi All,

    I got one issue to ask you guys.

    Here is a code in my VB6 application.

    Array(1,"P11","@P 100", "NEXT")

    However, now I'm converting this program to VB.Net and I'm stuck at this point.
    Can't find Array(xxx,xxx,xxx) in VB.Net 2010.

    Is there any option or function for this?

    Thanks.
    scsfdev
    I'm using VS 2005 & 2008 & 2010 with SQL Server 2005 Express.

    My hobby beside programming: http://dslrstranger.wordpress.com

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Array from VB6 to VB.Net

    This syntax is supported in VB 2010:
    vb.net Code:
    1. Dim myArray = {"element1", "element2"}
    Another option, which is also supported by older versions, is:
    vb.net Code:
    1. Dim myArray As String() = New String() {"element1", "element2"}
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Addicted Member scsfdev's Avatar
    Join Date
    Feb 2008
    Location
    Singapore
    Posts
    224

    Re: Array from VB6 to VB.Net

    Quote Originally Posted by jmcilhinney View Post
    This syntax is supported in VB 2010:
    vb.net Code:
    1. Dim myArray = {"element1", "element2"}
    Another option, which is also supported by older versions, is:
    vb.net Code:
    1. Dim myArray As String() = New String() {"element1", "element2"}
    Hi jmcilhinney,

    Thanks for your info.
    I'm using VS 2005 & 2008 & 2010 with SQL Server 2005 Express.

    My hobby beside programming: http://dslrstranger.wordpress.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width