convert string array to long array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Newbie,

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

Cor


"XML newbie: Urgent pls help!"
 
Does anyone have a snippet of code that will convert a string array to a
long array?

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


Mattias
 
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.ExportPositions(g_SessionID, cmbStartDateandTime.Text,
cmbEndDateandTime.Text, cmbAsset.SelectedText).ToString) as per the
following function

Public Function ExportPositions(ByVal SessionID As String, ByVal
StartDateTime As Date, ByVal EndDateTime As Date,
<System.Xml.Serialization.XmlArrayItemAttribute("AssetID",
IsNullable:=false)> ByVal AssetList() As Long) As Position()


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

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