473,473 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Use CType to Convert Array

Structure myXMLtype
Dim Filename As String
Dim sql As String
End Structure
....

Dim obj as New ArrayList
......

return CType(obj.ToArray, myXMLtype) 'This wont work

I know that CType() can't be used to convert a Array into a array of another type but is there any other method that will to do this
without having to create another array, and then do a loop where you convert each element?

Nov 20 '05 #1
2 4932
Hi,

Take a look at the arraylist's copyto method.
http://msdn.microsoft.com/library/de...opytotopic.asp

Ken
----------------------
"Jarod_24" <ja******@hotmail.com> wrote in message
news:f4******************************@news.teranew s.com...
Structure myXMLtype
Dim Filename As String
Dim sql As String
End Structure
...

Dim obj as New ArrayList
.....

return CType(obj.ToArray, myXMLtype) 'This wont work

I know that CType() can't be used to convert a Array into a array of another type but is there any other method that will to do this without having to create another array, and then do a loop where you convert each element?

Nov 20 '05 #2
Hi,

Take a look at the arraylist's copyto method.
http://msdn.microsoft.com/library/de...opytotopic.asp

Ken
----------------------
"Jarod_24" <ja******@hotmail.com> wrote in message
news:f4******************************@news.teranew s.com...
Structure myXMLtype
Dim Filename As String
Dim sql As String
End Structure
...

Dim obj as New ArrayList
.....

return CType(obj.ToArray, myXMLtype) 'This wont work

I know that CType() can't be used to convert a Array into a array of another type but is there any other method that will to do this without having to create another array, and then do a loop where you convert each element?

Nov 20 '05 #3

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

Similar topics

4
by: Joeri | last post by:
Hi, I'm struggling with this issue, maybe someone has already solved ik before. Here's the problem I Have : clsA witch is a base class clsB inherits from clsA clsC inherits from clsA clsD...
1
by: Logan X via .NET 247 | last post by:
It's official....Convert blows. I ran a number of tests converting a double to an integer usingboth Convert & CType. I *ASSUMED* that CType would piggy-back ontop of Convert, and that performance...
3
by: TS | last post by:
Is there a way to convert a variable from 1 type to another type that you determine at runtime? I'm trying to pull a value from a ListDictionary's key. The datatype of that key must be identical to...
3
by: Mark Kamoski | last post by:
Hi-- What is the difference between Convert.ToString(obj) and CType(obj, String)? (Assume obj is a variable of type Object.) Please advise. Thank you.
4
by: Mike Cooper | last post by:
There is something about inherited classes I evidently don't know... I wrote the following class: Class Class1 inherits System.Windows.Forms.DataGridTextBoxColumn End Class There is...
8
by: John A Grandy | last post by:
could someone please discuss the pros and cons of CType(MyDouble,Decimal) versus Convert.ToDecimal(MyDouble) .... and other such conversions ...
0
by: Jarod_24 | last post by:
Structure myXMLtype Dim Filename As String Dim sql As String End Structure .... Dim obj as New ArrayList ...... return CType(obj.ToArray, myXMLtype) 'This wont work
7
by: Brian Henry | last post by:
is there any speed diffrences between doing Ctype or directcast? I know about the inherite diffrences, but process usage time wise, does one take up more cycles then the other? thanks
8
by: =?Utf-8?B?d2lubGlu?= | last post by:
Hello Everything in .Net is an object and CTYPE converts one datatype to another datatype so why use Cstr, Cint or any other method to convert from one datatype to another?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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
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
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
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.