Problems with NorthWind JCL example

Posts   
 
    
ha1o avatar
ha1o
User
Posts: 6
Joined: 15-Jul-2005
# Posted on: 15-Jul-2005 22:11:48   

hi there, I have problems and I hope you can helpme.

I have been following the progress about JCL few weeks ago, so I still feel like I'm green in LLBL and JCL field. I have the "JCL_v1[1].2_06292005" and the "LLBLGEN PRO 1.0.2004.2 Final", and I made the example with NorthWind database that is in the pdf document file of JCL MANY TIMES,.... BUT I always have the same error >>>> "Cannot Create NWCustomers" (NOTE: I changed the table names because previous error)

I debugged the program and this is the everytime sequence:

(F11 key)

If dataForm.SetupForm(Me, "Northwind Customers", GetType(BL.NWCustomers), Nothing) Then

Return DoSetupForm(manager, friendlyName, dataType, filterBucket, data:=Nothing, recordPosition:=-1, showFind:=False)

If MyBase.DoSetupForm(manager, friendlyName, dataType, filterBucket, data, recordPosition, showFind) Then

Me.InitializeDataSource()

SetupDataSource(Me.dsCustomers, Me.dsCustomers.EntityFactoryToUse)

Me.SetupCurrentEntity()

Me.SetupUI()

obj = DirectCast(NewEntity(), EntityBase2)

Return Me.DataSource.EntityFactoryToUse.Create

Return m_dataSource (POING!!!!!)

This is the path that all the forms follow before they throw the exception. I don't know where I have to look or what I should do to fix the error. before the step 39 in the jcl.pdf file, you can be sure that everything is correct; but after that I am not sure what exactly I am modifying.

--I set the controls, and the configuration for each control --I did not find the "Me.txtstrJournalId" or the "Me.grd_GLJournalDetail" (NOTE: I thought those were Innecessary) --I replace the "DevExpress.XtraGrid.GridControl" for "JCL.Windows.WinControls.DataGrid" --I replace the "DevExpress.XtraGrid.Views.Grid.GridView" for "JCL.Windows.WinControls.DataGridView" --I replace the "DAL.FactoryClasses.OrdersEntityFactory" for "BL.FactoryClasses.OrdersFactory" (everyone) --I did not touch "UpdateControlEditStatus()" (NOTE: I thought those were Innecessary) --I modify "InitializeDataSource()" --AND I made the botton that call the form.

after all this, I still can't see what is the problem, what I'm missing. If any of you can helpme and want to see the code or something else, just ask.

thks for any help and time you can offer

omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 16-Jul-2005 09:58:05   

OK... first I want you to exclude the most common errors:

possibility 1 (lost entity factory)

1- go into the "Windows Form Designer generated code " region 2- go to the line

Me.dsCustomers.EntityFactoryToUse = ...

3- make sure that the above line does use a BL factory and not (NOTHING) or (NULL)

If the entity factory is NOTHING then you are facing a problem with DLL versioning. What you should do: 1- Make sure (JCL) and (JCL.Windows) projects reference the LLBL dll from your LLBL's installation folder (so that you are using the LLBL installation of your devolopment machine). NOW, rebuild the JCL dlls and then copy the resulting dlls to your solution's COMMON folder. 2- open your DAL solution and make sure that it references the LLBL dll from the same location that the JCL projects use. Rebuild the DAL dlls and copy them ot your COMMON folder. 3- clean-up your Northwind solution (delete the BIN and OBJ foders of the BL and Northwind projects) 4- open the Northwind solution and rebuild

Possibility 2 (DataForm and ListForm)

1- make sure that you do the (frmOrders) part of the tutorial (Data screen) and make sure it runs fine 2- now do the (frmCustomers) part of the tutorial (Lookup screen)

Remarks

--I did not find the "Me.txtstrJournalId" or the "Me.grd_GLJournalDetail" (NOTE: I thought those were Innecessary)

this is just an exmaple not related to frmOrders or frmCustomers.

--I did not touch "UpdateControlEditStatus()" (NOTE: I thought those were Innecessary)

agreed although this meens that your UI controls will not become Editable/ReadOnly as the form changes its Data Mode

One last thing... please donwload the latest update from the LLBL's 3rd party

ha1o avatar
ha1o
User
Posts: 6
Joined: 15-Jul-2005
# Posted on: 20-Jul-2005 01:20:22   

I have just finish the ideas you gave me, I made the JCL (JCL_v1[1].2_07122005.zip) sample with the last llbl (LLBLGenPro 13-07-2005.zip) and it didn't work. Thought the error is the same, it show up in another function.

this is the path when I debug the program:

If dataForm.SetupForm(Me, "Northwind Orders", GetType(BL.NWOrders), Nothing) Then

Return DoSetupForm(manager, friendlyName, dataType, filterBucket, data:=Nothing, recordPosition:=-1, showFind:=False)

Me.InitializeDataSource()

DB.LoadList(GetType(NWCustomers), DirectCast(Me.lkpCustomers, IEntityCollection2))

LoadList(objectType, list, Nothing, Nothing)

DataPortal.Execute("DataPortal_FetchList", New DB(objectType, list, prefetchPath, filterBucket))

m_objectType = objectType m_list = list m_prefetchPath = prefetchPath m_filterBucket = filterBucket

when the constructor finish, it throw the exception...

the truth is that I haven't really dig about the dataportal, so I'm going to try a little longer (My guess is that I should made the dataportal based in the "JCL.Server.DataPortal" project; right?). But I still am not sure if the dataportal is the problem...

I have some doubts I wanna ask too:

  • when the walkthrough askme to add a entitycollection object in the step 42.b and 42.c, it don't say which DAL Factory Class choose, so I make my chose by the name that the walkthrough show. So, for the step 42.b I chose "DAL.FactoryClasses.NWCustomersEntityFactory" and for step 42.c "DAL.FactoryClasses.NWEmployeesEntityFactory"

Is this correct??? <<

  • and something that call my attention is that when I'm about to select the datasource of any object in the property's window, all the datasources show up twice.

Is this suppose to happen? <<

http://www.idiots-guide.org/badday.htm

omar avatar
omar
User
Posts: 569
Joined: 15-Oct-2004
# Posted on: 20-Jul-2005 10:07:20   
  • when the walkthrough askme to add a entitycollection object in the step 42.b and 42.c, it don't say which DAL Factory Class choose, so I make my chose by the name that the walkthrough show. So, for the step 42.b I chose "DAL.FactoryClasses.NWCustomersEntityFactory" and for step 42.c "DAL.FactoryClasses.NWEmployeesEntityFactory"

Is this correct??? <<

when you add an entity-collection from the toolbox, the only entityFactory you can choose is that from DAL. When editing the code in the form, we would change the entityFactoryToUse property of the entityCollection from DAL to BL.

  • and something that call my attention is that when I'm about to select the datasource of any object in the property's window, all the datasources show up twice.

Is this suppose to happen? <<

This is a bug from VS.NET that FRANS explained when LLBL's desaign-time data-binding was released. You should NOT worry that you have the data-source showing up twice and it does NOT matter which one you choose.

To save you time and effort it would help if you could mail me the code (omar@atc.com.kw and Omar.Shraim@gmail.com). If that is possible for you then please ZIP the whole folder structure and their DAL, BL and Winforms projects. Please remeber to** remove all BIN and OBJ folders from all the projects **before you ZIP them to save on size...