XAML list control NOT showing bound data from edited - ProjectTrackerVB demo

XAML list control NOT showing bound data from edited - ProjectTrackerVB demo

Old forum URL: forums.lhotka.net/forums/t/8374.aspx


jaydawg posted on Monday, January 18, 2010

Hello All!

This is my first post in this community.

I am a Senior Software Engineer/System Architect in a growing IS department for a global Titanium manufacturer based in northeastern Ohio, USA.

 

I am responsible for putting together a completly custom MES system and, after some investigation, I plan to use the CSLA framework, VB.Net, a WPF interface, and data access layers to both SQL Server 2008 and Oracle 10g.

My Challanges:

* I am well versed in Oracle, but rather new to SQL Server

* I am just on my way to learning WPF.

* My strength is VB6. This is my first dotNet project.

* I am just on my way to learning CSLA.Net.

 

My issue:

I've read through the 'Expert VB 2008 Business Objects' book. I have somewhat of a foundation to build off of, but for hands-on I like to reverse-engineer working code.

I have taken the ProjectTrackerVB demo for PTWpf and I'm have introduced my own DataAccessLayer.Linq project using my own SQL Express database and my own Business Objects. I have successfully created OrderList and OrderInfo BOs based off of the ResourceList and ResourceInfo BOs.

The OrderList BO was successfully loaded with the data from my database file.

My problem is that the XAML is setup exactly like the ResourceList.xaml but the list control doesn't display the data in the OrderList BO.

I have even tried taking the code as close to the original demo as possible. I am using the ResourceList.xaml and I have adjusted only the Data Access code to pull from the other database.

 

ResourceList.vb file

Demo Code:

'Private Overloads Sub DataPortal_Fetch()

' RaiseListChangedEvents = False

' Using ctx = ContextManager(Of ProjectTracker.DalLinq.PTrackerDataContext).GetManager(ProjectTracker.DalLinq.Database.PTracker)

' Dim data = From r In ctx.DataContext.Resources _

' Select New ResourceInfo(r.Id, r.LastName, r.FirstName)

' IsReadOnly = False

' Me.AddRange(data)

' IsReadOnly = True

' End Using

' RaiseListChangedEvents = True

'End Sub

 

My Code:

#Region " Data Access "

Private Overloads Sub DataPortal_Fetch()

RaiseListChangedEvents = False

Using ctx = ContextManager(Of DataAccessLayer.Linq.ShopFloorDataContext).GetManager(DataAccessLayer.Linq.Database.ShopPro)

Dim data = From r In ctx.DataContext.SAP_Active_ProdOrders _

Select New ResourceInfo(CType(r.ProdOrdNum, Integer), r.ProdOrdNum, r.ProdOrdNum)

IsReadOnly = False

Me.AddRange(data)

IsReadOnly = True

End Using

RaiseListChangedEvents = True

End Sub

#End Region

#Region " Design Time Support"

Private Function DesignTime_Create() As ResourceList

IsReadOnly = False

Me.Add(New ResourceInfo(60000001, "60000001", "60000003"))

Me.Add(New ResourceInfo(60000002, "60000002", "60000004"))

IsReadOnly = True

Return Me

End Function

#End Region

The data.Results object has the appropriate data from my database.

The listbox in design time contains the test data from above.

When I run the application, the listbox shows nothing.

 

This is probably an easy fix, but I haven't found anything on my internet search.

I would appreciate any and all help.

Curelom replied on Monday, January 18, 2010

Could you post your XAML?

jaydawg replied on Monday, January 18, 2010

Here is the XAML code - straight out of the demo project.

ResourceList.xaml
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PTWpf"
xmlns:csla="clr-namespace:Csla.Wpf;assembly=Csla"
xmlns:PTracker="clr-namespace:ProjectTracker.Library;assembly=ProjectTracker.Library">

ObjectType="{x:Type PTracker:ResourceList}"
FactoryMethod="GetResourceList"
IsAsynchronous="False">












Resources:





ResourceList.xaml.vb
Imports ProjectTracker.Library

'''
''' Interaction logic for ResourceList.xaml
'''

Partial Public Class ResourceList
Inherits EditForm

Private Sub ShowResource(ByVal sender As Object, ByVal e As EventArgs)
Dim item As ResourceInfo = CType(Me.listBox1.SelectedItem, ResourceInfo)

If item IsNot Nothing Then
Dim frm As ResourceEdit = New ResourceEdit(item.Id)
MainForm.ShowControl(frm)
End If

End Sub

End Class

jaydawg replied on Tuesday, January 19, 2010

It looks as though I'm getting unhandled exceptions.

Here is the output from when the Resource List Listbox tries to load.

'PTWpf.vshost.exe' (Managed): Loaded 'H:\Visual Studio 2008\Projects\TimesSolution\PTWpf\bin\ProjectTracker.DalLinq.dll', Symbols loaded.

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll

'PTWpf.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in Csla.dll

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in Csla.dll

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in Csla.dll

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in Csla.dll

A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll

I'm looking up these exceptions now.

Any additional help would be appriciated.

ajj3085 replied on Tuesday, January 19, 2010

Looks like a WCF configuration problem.

I would start by running the dataportal in local mode.

Copyright (c) Marimer LLC