Hi Dan, Happy New Year! Just getting back to this and not having a lot of luck - I’m getting an “Expression does not produce a value” error from Intellisense (Visual Studio 2019) when I try to assign my version of “LoadResources()” - please see the attached images.
The sub that loads up the resource column scheduler is LoadAircraft() and everything is called via “LoadAircraftAndEvents()” - both generate the same error when I try them in the line:
Dim allResources As ResourceCollection = LoadResources()
Code for the subs that populate the scheduler:
Private Sub LoadAircraft()
Dim todaysDate As Date = Now()
dps_acv.Resources.Clear()
Dim sSQL As String = "select a.id,tnum,sn,type,a.oconus,location=(select location from t_aircraft_location where a.id=aircraft_id and returnDate > '" & todaysDate & "') "
sSQL = sSQL & "from t_aircraft a where inactive='false' and NOT RIGHT(tnum, 3) = 'SIM' order by oconus,location,type"
Dim da As New SqlDataAdapter(sSQL, ConfigurationManager.ConnectionStrings("DeimosDev.My.MySettings.db_conn").ConnectionString)
Dim dt As New DataTable()
da.Fill(dt)
For Each r As DataRow In dt.Rows
Dim name As String = DirectCast(r("tnum"), String)
Dim sn As String = DirectCast(r("sn"), String)
Dim id_Renamed As String = Convert.ToString(r("id"))
Dim oconus As String = Convert.ToString(r("oconus"))
Dim stroconus As String = "HomeBase"
If Not IsDBNull(r("location")) Then
stroconus = DirectCast(r("location"), String)
End If
Dim strStatus As String = "FMC"
Dim res As New Resource(name, id_Renamed)
res.DataItem = r
res.Columns.Add(New ResourceColumn(sn))
res.Columns.Add(New ResourceColumn(stroconus))
res.Columns.Add(New ResourceColumn(strStatus))
dps_acv.Resources.Add(res)
Next r
End Sub
Private Sub LoadAircraftAndEvents()
LoadAircraft()
dps_acv.DataSource = DbGetEvents(dps_acv.VisibleStart, dps_acv.VisibleEnd)
dps_acv.DataBind()
dps_acv.Update()
End Sub
I’m assuming that I’m doing something fundamentally wrong - any insight? Thanks…