I have an issue. I have 3 tables. Two tables use primary key link to a foreign key in the main table. So, the foreign key in the main table will link to 2 tables.
When I used LayerGen to generate code, I found a problem. The link to that 2 tables will have the same key. LayerGen will use the same name based on the foreign key name. This will raise an error.
Do I have to change the name of that key manually?
If I do like that, the main table will have 2 foreign keys link to different table, right? Is there any problem if I do?
First off I love LayerGen. I used the MMX version back in the day quite a bit and was happy to find an updated version recently.
I'm doing a very simple update to a db record however my ID value on my object isn't populated. With the below snippet, I can load the row however the .Id field (which matches the PK in the DB and is set to identity) remains 0 so it won't update.
I was testing your library to use in a small development, and I wanted to know how to use transactions. I'm using your library with SQL Server, so it is using SQL Client namespace.
Thank you in advance.
I honestly haven't tried it. However, I do know there are a few Win32 functions that I am using, all graphics and/or UI related. They could easily be eliminated. Now the code generated by LayerGen should be 100% Mono compatible.
LG Doesn't save my DataRow with Mysql-Database ...
It seems to be a problem with "_oldPrimaryKeyValue", there is a "0" value while saving the row?
When i change "command.Parameters.AddWithValue("@val16", _oldPrimaryKeyValue) for example to
"command.Parameters.AddWithValue("@val16", 1) it works.
"_oldPrimaryKeyValue" is always 0 in my case while updating one row like Adress.Save().
I've tried to duplicate this issue and cannot. Everytime I step into the Save() function, _oldPrimaryKeyValue is always equal to the value that was loaded (1). Please try using the debugger and stepping through your code, not just the Save() function, but also when you create the new object (Dim Adresse = New BusinessLayer.Kontakt_anschrift(CType(Me.txtID.Text, Integer))).
Really its a great project that help me a lot and save my time ... Appreciate it
but I'm in a big need to work with Entity Framework but I don't know how to merge it with your tool cause I know you built your BLL on your DAL by Inheriting one from another !!!!
The business layer does have a few dependencies on the data layer. Understand though that the data layer is designed to be swapped out with another data layer with minimal changes. The exceptions to this are the GetAll() and GetBySqlStatement() and GetByStoredProcedure() functions. These call data layer functions that put rows into a data table. As long as these functions exist in your new data layer, the business layer should continue to function properly.
You are correct in that the business layer cannot stand alone. It inherits a data layer. LayerGen, by definition, was designed to be a 3-tiered layered system, with your data layer on the bottom, the business layer in the middle and the UI on top.
thnx for reply, but I want to ask U How can I replace your data access layer with Entity Frame work. what are the steps to do that or -if you can- make a release with an option to choose If I want an EF or DAL???
Another Question : Is there any advantage to Use EF over your DAL - cause I'm new to EF?
am trying to populate a user name dropdown with values from the database (sqlite).
do u have a solution already to this issue i can follow before i mess
up layergen code...
Am using sqlite. The table create is this