What Is This List Of Objects (arrayLists) Being Cleared?
Jul 12, 2011
I am obviously not understanding something about scoping that is very basic. I have a very simple class:
Public Class testListClass
' This just contains a single list that is set by a property or the constructor
Private classArrayList As New ArrayList()
[code].....
View 5 Replies
ADVERTISEMENT
Jan 30, 2011
I have been tempted to use List(Of T) in VB.NET instead of ArrayLists by someone-who-must-not-be-named-Robinson.Essentially, what I need to store are three things: One string, two integers, and maybe two booleans. I liked using ArrayList, because it treated all its elements as "Objects" so I didn't really have problems storing that variety of elements.But now I have been thinking on using List(Of T). But how do I do to store that variety of elements of mine? I have been thinking on making a Structure holding the five elements.Sounds like a good idea? I heard somewhere that Structures are expected to have a short life. But I fear I will be having my structures for... forever, as long as my app lives. That makes any difference? Finally, what if I needed to create... dunno...... 125000000 Lists, each containing a structure? Is that possible (and good)?
View 2 Replies
Apr 22, 2010
url...I've got a drop down inside an update panel, and I am trying to get it to allow the person using the page to add users to a list that is bound to a gridview. The list is a global variable, and on page_load I set that to the gridview's datasource and databind it. However, anytime I click the 'add a user' button, or the button to remove the user from the list. It appears like it is doing a full post back even though all these elements are inside the update Panel.[code]Now I thought the point of an update panel was to be able to update things inside of it without doing a full post_back and reloading the page. So if that's the case, why is it calling page_load everytime I click the buttons? I ran this code and debug and I see that even before any of the code associated with button press fires, page_load runs again.I tried putting the gvAssociatedUser.Datasource = associatedFaculty and the line below inside the Page.IsPostBack check, that prevented the page from working. I tried every combination of settings of the update panel for ChildrenAsTriggers and UpdateMode, and none of them worked.
I've tried won't get it to work.It wasn't causing a full postback so I was wrong as to the cause. I thought the page was doing a full post back thus resetting my associatedFaculty list global variable, but it isn't doing a full postback.The issue I am having is everytime I click btnAddUser it will add one element to the associatedFaculty list and thus bound to gvAssociatedusers. This works the first time, but the second time I click it, it overwrites the first element. So it appears like my associated Faculty list is getting reset each time I click the button?
View 2 Replies
Jun 2, 2011
I would like to create list of child objects from list of parent object. Like If i have list of bookingroom which has one member room then i would like to create list of room from it.
eg. code:
Dim BookingRoomList As List(Of BookingRoom) = New List(Of BookingRoom)
Dim RoomList As List(Of Room) = New List(Of Room)
BookingRoomList = BookingRooms.FillGrid()
[Code]....
Is there any short cut method instead of iterating over for earch?
View 1 Replies
Jul 20, 2011
I'm having a bit of a 'brain doner' moment here
I have a list of Objects. Each of these Objects contains a list of other Objects (pseudo code) :-
Private Structure Object1
dim Name as string
dim ListOfObject2 as List(Of Object2)
[Code]....
I need to sort the list of Object1 by the Value in Object2. I have a comparison class which sorts Object2 by its Value nicely.
View 13 Replies
Dec 22, 2010
I have 2 classes
Public Class Shipper
Public Property ShipperID As Long
Public Property CreateDate As DateTime
[Code].....
View 1 Replies
Nov 23, 2011
I'm trying to create a list of days(integer) from a list of dates(date).
I tryed to do this....
[Code]...
View 4 Replies
Jan 24, 2010
I need two seperate lists, which every item is Integer, String, Bitmap - and one which every item is Integer, String String. However I don't know how to do this, or even where to look - I've googled for custom objects and custom object lists. What I'm trying to do is this.Custom Object1 is Integer, String, Bitmap Custom Object2 is Integer, String, String
In one thread I'll be adding items to List1(Of Object1), and processing them, and adding the results to List2(Of Object2), however I need to be able from other threads to look at the list and say only give me the items where Integer = (my thread ID), is this possible? Any help, or even links to information that would be relevant to this request would be helpful?
View 2 Replies
Sep 6, 2011
Limited to using v2.0 of .Net framework (we use VB.net) due to environmental constraints on our servers.I've got an ASP.net webpage which pulls data from a webservice that performs checks on user accounts in active directory. Operators can check multiple accounts at one time using the web interface. The webservice returns a list(of AccountCheck) objects which themselves contain single properties like username, email address, and List(of AccountError) objects which contain multiple properties.[code]What I want to do is using some kind of repeater, create multiple panels or divs which contain labels showing the username, email etc, and a gridview which has the accounterror list bound to it to show all the errors. The users could be checking 2, 5, 7 accounts at once, and is dynamic.
View 2 Replies
Nov 9, 2011
I have an Object structured as follows:[code]I thought this would work but I keep getting the following error: Object reference not set to an instance of an object.
View 1 Replies
Aug 26, 2011
I was wondering how I could go about getting a list of string from a list of objects, while removing duplicates[code]....
View 2 Replies
Dec 18, 2009
just needed to get my head round something. Say I have a class 'myClass' with properties ID and Name. Now say I have 2 lists of objects of this type as follows:
Dim list1 as List(of myClass) = GetList1()
Dim list2 as List(of myClass) = GetList2()
What I want is to 'intersect' (this may not be the right word!) the two sets of data by the Name property, but bring back the ID property from list1. A suitable database analogy would be if list1 and list2 were tables, I'd want to do a left join from list1 to list2 on the Name field.
View 1 Replies
Oct 7, 2011
The scenario is this, I have several variables that are set as a list(of objects). The values for these lists are populated during code via a SQL query. I want to be able to take these values and then use them within another SQL query. Each time the program runs the values will be different and there will be more or less within the list.
View 6 Replies
Aug 14, 2009
I have a superclass NetworkTest and 3 derived classes PingTest, Pop3Test, SMTPTest. I want to create a big list of all the tests, like this:
[Code]...
View 12 Replies
Oct 15, 2009
I have a procedure in VB.net using VS.net 2008 which will get the list of Orders and build a XML file with the list of Orders as shown in the code below: As the number of Orders is getting huge, I want to build the XML file for every 500 Orders
[Code]....
Instead of building XML for all the records I want to create XML for each 500 records. I tried the following code and it is throwing an error saying Expression is of type Orders which is not a collection type.
[Code]....
View 4 Replies
Mar 9, 2010
I have started using BindingList(Of T) for my generic collections whenever I need the objects to interface with the GUI instead of List(Of T). This has worked well for me so far but a few of my collections are stored in Dictionary(Of TKey, TValue) and there doesn't appear to be a corresponding BindingDictionary(Of T).
Has anyone else come across the necessity to use this, and how did they achieve it? Should I implement this myself? (How?) or is there a better solution already available?
View 1 Replies
Apr 21, 2010
Why I couldn't have a separate list of objects of the same class?
This one works,
Dim list As New List(Of Address)
list.Add(New Address With { _
.Country = "USA", _
[Code]......
View 3 Replies
Mar 16, 2012
Suppose I have:
Public Class myClass1
Dim foo As String
Dim bar As String
[code].....
View 23 Replies
Dec 7, 2011
I have a VB 2010 class like
Public Class cStar
Public Name As String
Public Magnitude As Single
End Class
I want to add stars into some doubly linked collection or list that is ordered by magnitude.
I tried to create my own list cList based on collection
Class cList Inherits collection error - collection not inheritable End class
I had hoped to enable things like
Dim Star1 as cStar
Dim Star2 as cStar
cList.AddFirst(Star1)
cList.AddLast(Star1)
Star2 = cList.Behead
[Code]...
View 4 Replies
Jun 8, 2009
I am a .net programmer vb & c# but i can't seem to figure out how to get my objects into a list or array in php. var mylist = new List<myobject>();
mylist.add(myobject1);
mylist.add(myobject2);
what i have tried. Products being a property for a collection of orderitems
$this->Products = getOrderItems();
public function getOrderItems()
{
$items = array();
[Code]...
View 3 Replies
Mar 29, 2010
I have to ask my first question at some point, so here she goes.I am trying to create a dynamic list of objects. The objects will have several types (String, Integer) associated with them. Currently I am forming a Collection as I instantiate new objects.Is there a prefered to map this collection to, say, a Datagridview? Will I have to Iterate through the collection and add the rows at each iteration?Would I be better served using an ArrayList or something else over a Collection?
View 8 Replies
Jul 18, 2010
I am implementing IDisposable for a class and while disposing there is a internal list of disposable objects. Should I be disposing those object by looping through them.
public Class MyDisposable
Implements IDisposable
private _disposbaleObjects as new List(of OtherDisposables)
[Code].....
View 3 Replies
Jul 5, 2011
I have a question about locating a particular object in a generic list. I have 2 lists, one contains a list of every song in a library and the other contains only copies of some the those elements that are added to a playlist. How would I locate and change a value of an particular item in a list by comparing one of their variables such as name? Or find it's index in the masterlist.
View 14 Replies
Mar 1, 2011
I have list object and I need to check id in a comma separated string using LINQ in VB.NET, something like this:
dim strId as String = "1,2,3,5,"
dim myList = from objmylist where objmylist.id in (strId)
View 4 Replies
Apr 22, 2011
I have a List of objects shared by multiple threads, it sometimes generate IndexOutOfRangeException when trying to Clear. While searching for solution I found that I should use SyncLock while accessing the List. But my question if what is the importance of lockObject in SyncLock block
E.g. while clearing myList
Can I use
Synclock myList
myList.Clear
End SyncLock
or lockObject should be different from myList?
What I think about sysnclock is "lock is obtained for object specified as lockObject". What if I specify list to be cleared as lockObject, shouldn't the compiler supposed to obtain the exclusive access to list before clearing it ?
View 1 Replies
Dec 8, 2010
Okay so I've created a list of objects from a class like
[Code]...
View 1 Replies
Jul 9, 2009
Anyone know of some code out there that does this already? I have a bunch of pages with data grids on them in an admin website they want to export them to Excel, was hoping someone had this written already
View 1 Replies
Apr 26, 2011
I'm trying to pass a list of objects to my WCF service, but it doesn't seem I can pass an object list from my console test application. I have an error that states:
Value of type
'System.Collections.Generic.List(Of
ConsoleTestingApp.ServiceReference1.LetterVariables)'
[code]....
View 1 Replies
Oct 2, 2009
Is there a way to print a list of all objects on a form? I have lots of textbox boxs on a form and i would like to print a lit of them.
View 10 Replies
Jul 2, 2010
I have two arraylists, and I would like to have a new arraylist with only the uncommon items. Is this the "best" or at least decent way to do it?
[Code]...
View 2 Replies