Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Concept of Loading Collection of objects help
Message
From
24/10/2006 15:52:10
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01164073
Message ID:
01164171
Views:
8
Kirk,

Most examples I see in documentation need a little "real world" refactoring. <g> Here's what you need to do:
   dim oResourceObject as 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 = New DevExpress.XtraScheduler.Resource
        oResourceObject.Caption  = drv2("ResourceName")
        oResourceStartTime = drv2("ResourceStartTime")
   Next
~~Bonnie



>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
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform