473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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.
Mar 9 '06 #1
3 4311
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!"
<XM********************@discussions.microsoft.co m> schreef in bericht
news:F2**********************************@microsof t.com...
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.

Mar 9 '06 #2
>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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mar 9 '06 #3
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("A ssetID",
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"
"Cor Ligthert [MVP]" wrote:
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!"
<XM********************@discussions.microsoft.co m> schreef in bericht
news:F2**********************************@microsof t.com...
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.


Mar 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andrew V. Romero | last post by:
At work we have an excel file that contains the list of medications and their corresponding strengths. I would like to save the excel file as a text list and paste this list into a javascript...
2
by: Mel WEaver | last post by:
Hello, I have the following delphi structure for a binary file. I'm looking for idea how to read this file. Mel type TMenuDataStruct = packed record exename : string;
1
by: Mark Hollander | last post by:
Hi All, Could you please help me convert this code so that it will run in VB.NET Thank You Mark Hollander Private Type USER_INFO Name As String
5
by: XML newbie: Urgent pls help! | last post by:
function to convert string to 1 dimensional array of long in VB.Net
43
by: Steven T. Hatton | last post by:
http://public.research.att.com/~bs/bs_faq2.html#int-to-string Is there no C library function that will take an int and convert it to its ascii representation? The example Bjarne shows in his faq...
29
by: Harlin Seritt | last post by:
Hi... I would like to take a string like 'supercalifragilisticexpialidocius' and write it to a file in binary forms -- this way a user cannot read the string in case they were try to open in...
19
by: est | last post by:
From python manual str( ) Return a string containing a nicely printable representation of an object. For strings, this returns the string itself. The difference with repr(object) is that...
14
by: rtillmore | last post by:
Hello, I did a quick google search and nothing that was returned is quite what I am looking for. I have a 200 character hexadecimal string that I need to convert into a 100 character string. ...
15
by: khumayun | last post by:
i have a byte array that contains hex values. i want to convert 6 bytes of it into decimal values and display the result as a string. also when do i have to take the endianess into consideration?...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.