Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Concept of Loading Collection of objects help
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Concept of Loading Collection of objects help
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01164073
Message ID:
01164073
Views:
46
I need a little help in understanding a what is probably a very basic and easy concept. Everything in .Net is an object, seems like every control from a listbox to a grid, is based on some object be used with .Add() that is assoicated to some collection or another. In all the examples it appears as 1) create an "item" object, set its values, then use the collections .Add() method and the example is always kind of like below, they name the objects, object1,object2,object3..etc. which is perfect if you know how may objects your going to have.
      Dim myResource1 As New DevExpress.XtraScheduler.Resource
      myResource1.Caption = "Room 1"
      Me.SchedulerStorage1.Resources.Add(myResource1)

      Dim myResource2 As New DevExpress.XtraScheduler.Resource
      myResource2.Caption = "Room 2"
      Me.SchedulerStorage1.Resources.Add(myResource2)
In my case, and most others probably, the number is unknown and determined when I get a dataview created. So my question is, how do I load those items into the collection in a generic fashion.

I picture this, but it doesn't seem to work most of the time, leaving only one object created.
   dim oResourceObject as New DevExpress.XtraScheduler.Resource
   ' Get a dataview with all the records
   Dim goResources As DataView = GetDataViewObject.GetDataView(cSQL)

   Dim drv2 As DataRowView
   For Each drv2 In goMeetProc
        oResourceObject.Caption  = drv2("ResourceName")
        oResourceStartTime = drv2("ResourceStartTime")
   Next
Thanks for any help and pointers.

Kirk
Next
Reply
Map
View

Click here to load this message in the networking platform