List Of Superclass Objects?

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


ADVERTISEMENT

Create List Of Child Objects From List Of Parent Object?

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

VS 2005 Sort List Of Objects By Child List Order?

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

.net - Searching A List Of Objects In An Object List Using Linq?

Dec 22, 2010

I have 2 classes

Public Class Shipper
Public Property ShipperID As Long
Public Property CreateDate As DateTime

[Code].....

View 1 Replies

Linq - Create A List Of Integers From A List Of Objects?

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

Multithreading - Create Custom Objects/list Of Custom Objects In .NET?

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

.Net OOP Superclass Base.net And Constructor Parameters?

Mar 13, 2009

I have a base class that contains a fairly large number of parameters in it's New constructor. I have 7 subclasses that inherit the Super base class. My question/issue is, all of the subclasses use the same values for most of the parameters in the New constructor of the base class and these subclasses can be called one after the other. I would like to populate the common values for the superclass and then use those for each of the subclasses, but I can't come up with a good way to do this. If I could figure out how to do this, I wouldn't have to pass all of those parameters in the MyBase.New call for each subclass. I'll try to illustrate with some code .

[Code]...

View 3 Replies

Superclass Access To Inheriting Class?

Dec 19, 2009

I have 2 business classes, user & salutation and 2 DAL classes of the same name.

The business classes both have properties of the data class E.g.

Public Property Data() As Data.Salutation
Get
Return _Data

[Code].....

To access some data, you would do Business.Salutation.Data.SalutationID

Both busines classes inherit from BaseClass which contains all my database access methods.

Is there a way that I can access the Data property of the inheriting classes from the BaseClass?

I assume I will need to use reflection as the property types will always be different.

View 2 Replies

Display A List (Of Object) Which Has Single Objects And Child List (Of Object)?

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

Adding To A List Of Objects

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

Get List Of String From Objects?

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

Intersecting List Objects?

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

List Of Objects Into SQL Query?

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

Looping With List(of Objects)

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

Objects To Interface With The GUI Instead Of List(Of T)?

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

Separate List Of Objects?

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

Sorting A List Of Objects?

Mar 16, 2012

Suppose I have:

Public Class myClass1
Dim foo As String
Dim bar As String

[code].....

View 23 Replies

Add Objects Into A Doubly Linked List?

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

C# - Create A List Or An Array Of Objects In PHP?

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

Create A Dynamic List Of Objects?

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

Dispose A List Of Disposable Objects?

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

Finding A Particular Item In A List Of Objects

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

LINQ Filtering List Objects?

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

List Of Objects - How Does SyncLock Works

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

List Of Objects And Shared Events

Dec 8, 2010

Okay so I've created a list of objects from a class like

[Code]...

View 1 Replies

List Of Objects To Excel Spreadsheet?

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

Pass A List Of Objects To WCF Service?

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

Print A List Of All Objects On A Form?

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

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

Accessing Objects From Within A Custom Object List

Mar 3, 2009

OK - for starters - I'm not even sure that the title of this thread accurately describes what I want to do - but I had trouble verbalizing it. So I will give this a try: In my application, I have a custom object, call it myObject. In addition, I have another custom object called myObjectList which is basically a List(Of myObject).

Up until this point, all of the functions that I have been working with in my BLL and DAL have been shared - I haven't needed a specific instance of my object thus far. I currently need to write a function that finds a particular myObject within myObjectList and returns to me myObject. I know that the List(Of T) has a find method, but from what I have read so far - I don't think it is what I want (doesn't it return true or false? -and also, do I need an existing object to pass to it to see if it is in the list?)

[Code]...

View 5 Replies







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