473,503 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting from combobox.text to long()

Does anyone have a snippet of code that will convert a string 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.

Mar 8 '06 #1
2 2318

"XML newbie: Urgent pls help!"
<XM********************@discussions.microsoft.co m> wrote in message
news:C6**********************************@microsof t.com...
Does anyone have a snippet of code that will convert a string 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.


three steps
first - use the split function to convert the string into an array (of
strings)
then - redim your long array to the same size as your string array
then - iterate through the string array - converting each string into a long
(system.convert...) and assigning the value to the associated long array
element.
HTH
Mar 8 '06 #2
Hi,

Thanks a lot for your quick response. Could u pls explain in code what u
have mentioned(especially how to do second part)

I have a combobox that displays Asset names. 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 follwing
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()

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

I have spent 2 weeks on this. I don't know what to do.Pls help

God bless u.

"Hal Rosser" wrote:

"XML newbie: Urgent pls help!"
<XM********************@discussions.microsoft.co m> wrote in message
news:C6**********************************@microsof t.com...
Does anyone have a snippet of code that will convert a string 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.


three steps
first - use the split function to convert the string into an array (of
strings)
then - redim your long array to the same size as your string array
then - iterate through the string array - converting each string into a long
(system.convert...) and assigning the value to the associated long array
element.
HTH

Mar 8 '06 #3

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

Similar topics

7
3552
by: Kiteman - Canada | last post by:
I have a ComboBox (style 2) with 25 items in it. When I click on the arrow to see the items, I can only see the first 8. I have to scroll to see the others. Is there some way so set how many...
1
2689
by: Norm | last post by:
Hi All, I have a combobox that is being sourced by a table of very long strings. However, only the first 254 characters of my strings are being filled into the combobox. Is there a way to get...
8
12066
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
2
6168
by: Don | last post by:
I've looked high and low for some code that will allow me to have a combobox with a flat borderstyle. I found a few examples, but nothing that was really usable for me. I had the following...
0
7207
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
7357
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...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3171
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1522
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.