Results 1 to 5 of 5

Thread: Passing a "new string"

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    413

    Passing a "new string"

    Why would youe use "New String" to pass this paraemter?

    VB Code:
    1. ds.Load(dataReaderMaritalChoices,_
    2.   LoadOption.OverwriteChanges,_
    3.   New String() {"MaritalStatusChoices"})
    Visual Studio .NET 2005/.NET Framework 2.0

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Passing a "new string"

    I can't see a good reason to do that, where did you get it?
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    413

    Re: Passing a "new string"

    Microsofts 101 samples
    Visual Studio .NET 2005/.NET Framework 2.0

  4. #4
    Frenzied Member Icyculyr's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    1,934

    Re: Passing a "new string"

    I assume it would be the same as passing ""

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

    Re: Passing a "new string"

    That code is not creating a new String object. It's creating a new String array with one element. That code is equivalent to this:
    vb.net Code:
    1. Dim arr As String() = {"MaritalStatusChoices"}
    2.  
    3. ds.Load(dataReaderMaritalChoices, LoadOption.OverwriteChanges, arr)
    The same result but less succinct.
    Last edited by jmcilhinney; Dec 15th, 2007 at 09:53 PM.
    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

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