VS 2008 Using ArrayList With Own Structure?

Oct 11, 2009

I'm trying to use my own structure as a dynamic array (ArrayList?) but can't find the right syntax.

Public Structure BLsCompsRootDir
Public BL As String
Public Component As String

[code].....

View 7 Replies


ADVERTISEMENT

Struct - .net 2003 Arraylist Of Structure Which Have An Arraylist?

Sep 22, 2011

I have two structures Public Structure myResearchData

Public batchName As String
Public arraylistRData As ArrayList
End Structure
Public Structure myResearchSubData
Public researchDescription As String

[Code]...

Cleared MyResearchData.arraylistRData for new data to be put in but it also clears the arraylist inside MyResearchDataAList and didn't old the contents of the arraylist

View 1 Replies

Arraylist Of Structure Within Array Of Structure?

May 23, 2010

I want to make a structure within a structure. Basically it will appear like this:

Structure ID
dim CardType as string
im CardCode as string

[code]......

View 13 Replies

Changing Structure Of An Arraylist

Feb 8, 2011

I have created a Class Library (dll) with a module and a class in it.The module declares a structure, and an instance of this structure.In the class, there is an arraylist declared.My main program calls a function in the class library class. The class calculates data, stores it in the instanceof structure. Then adds it to the arraylist.When i want to use this data in my main program, i get a Cast void error. Its because The structure of the data in the array if of the structure in Class Library module. Is there a way to change the structure of this array to an identicle structure in the main programs Module. When the function returns the arraylist I have tried storing it in a tmp arraylist and copying, cloning etc the data into another arraylist in my main program. still not working. Do i have to loop through all the data and copy each value to a new instanceofstructure, and store this in the new arraylist?

View 3 Replies

Edit A Value In An Arraylist With Structure?

Jul 24, 2011

a simple question:I have this structure:

View 8 Replies

Use An ArrayList As A Property In A Structure?

Mar 26, 2010

I was wondering if I can use an ArrayList inside a structure as one of the structure's properties.Or it may be better to replace the structure with a class. If so, can I use an ArrayList as a property of the class.So what I want to do is have the ArrayList as the property of the structure and be able to add items to the ArrayList and clear the ArrayList from a clear method of the structure.

i.e.,
structure.ArrayList.Add (item)
structure.Clear

[code].....

View 7 Replies

.NET ArrayList Structure NullReference Exception

Sep 26, 2009

I keep Getting a NullReferenceException Error but I have declared a NEW structure. See below:

Structure ISACReply
Public RTD As ArrayList
Public SAC As ArrayList
Public DRT As ArrayList

[code]....

When I try to execute the subroutine "calltest" I get a NullReferenceException in the line that says " rv.DRT.Add("HELLO") " even though I have set rv to an instance of ISACReply using NEW.

View 6 Replies

Adding Textbox Name And Text To ArrayList Using Structure?

May 20, 2011

I have a function which iterates through the TextBoxes in my form (and its child controls) and adds each TextBox's name and text to an ArrayList using a structure I called valTxtBox.

Here's a snippet of the
VB.NET
Public Structure valTxtBox
Public nome As String
Public texto As String
End Structure
[Code] .....

Now, the problem is that if I call Clear() for valsTxtBox in the getctrls() function, not all the elements get added to the ArrayList. However, if I don't call Clear() it works just fine. BTW, I'm using VS2008 express which might be relevant.

View 5 Replies

ArrayList Of User Defined Structure Type?

Nov 19, 2008

I have a structure like this:

Code:
Public Structure Interval
Public temp As Double

[Code].....

'I want to be able to add to the array like an ArrayList though... 'after assigning values, like this:

interval(0).add

View 1 Replies

VS 2008 - Reading ArrayList In My.Settings And Add Another ArrayList To It

Sep 21, 2010

What I need to do is read an ArrayList in My.Settings and add another ArrayList to it. The first think I'm trying to do is load My.Settings.Records into myArrayList. I'm not quite sure on the proper way to do this. I've tried things such as Dim myArrayList As ArrayList = My.Settings.Records, I'm not sure if I need New and I'm not sure if I need .Clone or .CopyTo.

Then I have another ArrayList myArrayList2. To get this into myArrayList I've done: [Code] Then to save it back to My.Settings I've done. My.Settings.Records = myArrayList. The problem is I keep on getting Object reference not set to an instance of an object error on the AddRange line. My.Settings.Records is definitely an ArrayList and it will sometimes = Nothing. The objects will only ever be strings.

View 19 Replies

VS 2008 Convert The XML Structure Into A Class Structure?

Apr 25, 2010

I'm having a problem that's driving me crazy; I can't understand how to convert the XML structure into a class structure (that I want to use to hydrate a XML document).

The XML document looks like this:

xml
<?xml version="1.0" encoding="utf-8"?>
<artists xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns="http://www.spotify.com/ns/music/1">

[code]....

View 2 Replies

Array Or ArrayList Or Structure In An Array?

Nov 9, 2010

After gathering the Machine names on the (sealed) LAn i am then getting the ip addresses, MAc address and Macine User name of each machine on the LAn..These details will need to be accessed seperately for use in the security testing and i am unsure how best to store the active data (though eventually in a database) Am i best to create a Multidimensinal arrayList or array(bearing in mind that all the data is convereted to "String" (arrays can only store one data type??) The data found on the live network is allways changing making an array a difficult choice? I have read some tutorials mentioning making a structure with the data and storing this in an arraylist but i dont know whether this will make accessing the individual data items (ip,MAc,HostName etc) a difficult procedure?

View 1 Replies

Copy The List Of Principal User To Arraylist To Use Arraylist.indexof?

Dec 1, 2011

What I am doing is iterating through all the groups that belong to the top group (Generic reports). Then I take advantage of the GroupPrincipal.GetMembers(True) which will recurse through a given group name. I test to see if the user exits under that group and if true I put the group name in an arraylist.

I use the for each principal in GroupPrincipal.GetMembers to loop through each returned user to see if they exist.

Is there a way to put all the returned users Principal.Name from a given group in GroupPrincipal.GetMembers into an ArrayList? This would allow me to to use Arraylist1.IndexOf to search for user. Which would be much faster then iterating through a returned list using the for each construct.

Sub RetAllMbrs(strUser As String)
Dim oPC As PrincipalContext = GetPrincipalContext() '<- this is function somewhere else in the code

[Code].....

View 1 Replies

VS 2010 Threading & ArrayList - Use Adding A String To ArrayList In Tread?

Jan 11, 2012

I have a problem in Treading.I have a code like this;[code].....

I want to change ListBox1 with ArrayList. But I couldn't find how to use adding a string to ArrayList in tread.

View 5 Replies

Question If ArrayList Contains String Remove It From New ArrayList

May 6, 2010

I have an arraylist (arrFirstArry) which I use to populate another arraylist (arrNoDuplicates) preventing any duplicates from being added. This works fine. What I would also like my code to do is prevent adding any partial values which may exist from being added. i.e. my array is like this

[Code]...

View 2 Replies

VS 2008 - Any Way To Save ArrayList To XML?

May 8, 2011

I would like to know if there is anyway to save arraylist to xml. Below are my code,

vb
Public Class Video
Public vName As String
Public vFile As String
Public vType As String
Public xTL As Integer
[Code] .....

View 1 Replies

VS 2008 ArrayList Usage

Mar 23, 2009

I am new to arraylist. I have used standard 2 dimension or single dimension arrays which is there is .net & legacy VB.What I want is removing & searching in arrays to be easy ? VB.net does provide something called arraylist whereby we can remove items easily like X.removeat (index) or x.remove (search) etc.[code]Now I have a array person. To add i do redim person(10) or using preserve if I need to dynamically add etc. To remove is a pain as I need to copy contents and remove manually.Anyways in .net you have option called ArrayList.How can I use this to make life easier? If I want an arraywhereby I can do person.removeat (2) or person.add person.name="XYZ" & so on.Just wanna ease up on searching & removing.

View 6 Replies

VS 2008 Serialize Arraylist To Xml

May 12, 2011

I know how to seralize my arraylist to xml using vb.net?

View 2 Replies

VS 2008 - How To Create ArrayList From MDI ChildForms

Aug 11, 2009

I want to create an arraylist from MDI childforms and I did it like this:
vb.net
Dim sl As New SortedList(Of Integer, Form)
Dim i As Integer
Dim form As Form
For Each form In Me.MdiChildren
[Code] .....
It's working great, that means that if I delete a childform for example number 2 from all 3 then it creats first number 2 again and then number 4. Now the problem is that It only shows the childformnumber in the parentformtext instead of the name and number of that childform,like this: parentform - childform 1

View 8 Replies

VS 2008 : Updating An Arraylist Using A For Each Loop?

Oct 13, 2011

I can do this with a for loop, but I was just curious if an arraylist can be updated using a for each loop. ie

For Each arrItem As String In myArrayList
arrItem = "My Stuff"
Next

If I loop through the arraylist again the values remain unchanged.

View 4 Replies

VS 2008 Arraylist Sort And Binarysearch?

Aug 25, 2010

I have a windows app and I'm trying to cache images in memory. I have:-

[code]...

I think I have to sort the array to be able to use binarysearch.So I need to sort the arraylist on TileDetails.TileURL(if possible) and then binarysearch on it.

View 10 Replies

VS 2008 Updating A Access Db From An Arraylist?

Jun 30, 2010

I have a access db that contains logs in it from a project of mine. I have set up a total of 10 columns per row for log ids to be inserted ex: Log_1, Log_2, Log_3, etc...

The logs are pulled from an XML file that I downloaded and extracted from in an array list: log_id_1, log_id_2, log_id_3, etc...The db columns are a fixed number, 10. While the log id in the array list are variable, from either none upwards to about 20 of them.

If my arraylist has more entries in it than db has positions, I dont get an error, but if my array list has fewer than the 10 fixed columns in the db, I get an index error.What should I do to fix the error, capture the error and ignore it or is there another, better method?

View 4 Replies

Structure Inside Another Structure Receives Null Reference Error?

Jan 5, 2012

Module Module1
Public Structure structure1
Public TRANS() As structure2
End Structure
Public Structure structure2
Public X() As Integer
End Structure
End Module

View 17 Replies

VS 2008 - Create Or Initialize An Multidimensional Arraylist?

Apr 21, 2011

may i have an simple example to create,initialize an multidimensional arraylist some thing like

Dim i As ArrayList()()() and add / retrieve the values from specified indices

View 4 Replies

VS 2008 - Delete Selected Arraylist Item

Apr 28, 2011

how do I do the code if I wanna delete a selected item from the array list and not all the items store in the array list? [Code]

View 2 Replies

VS 2008 Move Items Between ArrayList And ListBox

Mar 23, 2010

I need to know how to save listbox items into ArrayList And restoring these items back from Arraylist into Listbox I tried this code but it returns Null Error Exception

[Code]...

View 2 Replies

[2008] - Deserialize An Empty Arraylist Collection?

Mar 6, 2009

the vars outside the procedure

Dim rentalRecords As New ArrayList() ' The arraylist containing the records
Dim carRecords As New ArrayList()
Dim currentRecordIndex As Integer ' The index of the current record

[code]....

View 1 Replies

Class Structure - Large Structure That Has Lots Of Properties ?

Jan 5, 2010

I'm new to VB 2008 after having spent a long time with VB6, so I apologize if this is a stupid question. But I'd really like to have this straightened out.

Let's say I have a pretty large structure that has lots of properties.

Code:

Now say that I want an internal database with about 10 instances of this structure total, describing, say, 10 different products that a store sells. When these values are loaded from a database, they remain totally static. (However, they can be different each time a program loads)

Now say that I have a class. Each instance of this class is a type of that BaseProduct structure. Meaning, each instance of the class pertains to one of the 10 types of products that the store sells. However, this class has additional properties that pertain specifically to each instance, which are not static.

Code:

Now, the problem here is... If I have 200 different transactions, each one contains an instance of BaseProduct. BaseProduct is HUGE, and is largely redundant (only 10 types possible), so I think it's a little silly to include a whole copy of it with EVERY transaction. However, the Transaction class really needs information regarding the base product it pertains to. Is there a way to, instead of declaring a New BaseProduct in the Transaction class, to simply make one of the properties of the Transaction class a pointer to a BaseProduct variable?

In VB6, I would accomplish this by making a BaseProduct(10) array, and then giving each Transaction an ID number referring to an entry in that array. But in VB 2008, using class structure, this is impossible. I can't define the BaseProduct(10) array outside of a class in a namespace, and if I define it in the actual application's form, then the class loses modularity since it relies on the application that's using it.

View 11 Replies

Converting Structure Within Structure To Byte Array For Socket

Aug 29, 2009

I am trying to communicate with an external device and i am trying to send a byte array to the external device via sockets but i am always getting a response the message size is too small so i am not sure what i have done wrong. Between the data type there should be no alignment present and all numbers are represented in little endian format. The char array is not null terminated as mentioned in the protocol specifications.

I have to send data based on a struct that embeds 2 other struct. So here's my vb.net code for the struct used to convert to byte array and the sending part.

Public Structure MESSAGETYPE_OIP_Login
Dim Header() As COMMANDHEADER
Dim UserName() As PSTRING

[Code]....

View 2 Replies

VS 2008 : Have Multiple Threads Input Data Into The Same Arraylist

Dec 20, 2009

I want to have multiple threads input data into the same arraylist, so they would need to share it. If this is possible how can I do this task?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved