convert string array to long array

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • XML newbie: Urgent pls help!

    #1

    convert string array to long array

    Does anyone have a snippet of code that will convert a string array to a
    long array? I've nearly smashed my head against the wall trying to figure
    this out.

    I'm Using vb.net 2005

    Pls reply asap. I thaanku all in advance. God bless u.

    Pls reply with code.


  • Cor Ligthert [MVP]

    #2
    Re: convert string array to long array

    Newbie,

    It is probably better that you explain why. Mostly are there some
    misunderstandin gs about strings and longs by newbies as they are in Net.

    Cor


    "XML newbie: Urgent pls help!"
    <XMLnewbieUrgen tplshelp@discus sions.microsoft .com> schreef in bericht
    news:F24A4ACE-D91A-49FA-BFE6-D71B5CA43D03@mi crosoft.com...[color=blue]
    > Does anyone have a snippet of code that will convert a string array to a
    > long array? I've nearly smashed my head against the wall trying to figure
    > this out.
    >
    > I'm Using vb.net 2005
    >
    > Pls reply asap. I thaanku all in advance. God bless u.
    >
    > Pls reply with code.
    >
    >[/color]


    Comment

    • Mattias Sjögren

      #3
      Re: convert string array to long array

      >Does anyone have a snippet of code that will convert a string array to a[color=blue]
      >long array?[/color]

      What's the format of each string and how do you expect it to convert
      to a Long?


      Mattias

      --
      Mattias Sjögren [C# MVP] mattias @ mvps.org
      http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
      Please reply only to the newsgroup.

      Comment

      • XML newbie: Urgent pls help!

        #4
        Re: convert string array to long array

        I have a combobox that displays Asset names. Asset List is a long array of
        AssetIds. Every Asetname in the combobox is associated with AssetID.

        I need to pass an array of AssetIDs as long from here(every assetname has
        assetid) into the following line:

        doc.LoadXml(EDP .ExportPosition s(g_SessionID, cmbStartDateand Time.Text,
        cmbEndDateandTi me.Text, cmbAsset.Select edText).ToStrin g) as per the
        following function

        Public Function ExportPositions (ByVal SessionID As String, ByVal
        StartDateTime As Date, ByVal EndDateTime As Date,
        <System.Xml.Ser ialization.XmlA rrayItemAttribu te("AssetID",
        IsNullable:=fal se)> ByVal AssetList() As Long) As Position()


        When, I do cmbAsset.Select ed Text, it is stored as string array and the
        function expects it to be array of Long.

        Everything is fine, except the cmbAsset.Select edText. I get the error"can't
        cast string to an array of long"


        "Cor Ligthert [MVP]" wrote:
        [color=blue]
        > Newbie,
        >
        > It is probably better that you explain why. Mostly are there some
        > misunderstandin gs about strings and longs by newbies as they are in Net.
        >
        > Cor
        >
        >
        > "XML newbie: Urgent pls help!"
        > <XMLnewbieUrgen tplshelp@discus sions.microsoft .com> schreef in bericht
        > news:F24A4ACE-D91A-49FA-BFE6-D71B5CA43D03@mi crosoft.com...[color=green]
        > > Does anyone have a snippet of code that will convert a string array to a
        > > long array? I've nearly smashed my head against the wall trying to figure
        > > this out.
        > >
        > > I'm Using vb.net 2005
        > >
        > > Pls reply asap. I thaanku all in advance. God bless u.
        > >
        > > Pls reply with code.
        > >
        > >[/color]
        >
        >
        >[/color]

        Comment

        Working...