LLBLGen Pro 2.6 with SQL Server 2016

Posts   
1  /  2
 
    
Vivek30
User
Posts: 33
Joined: 30-Jun-2016
# Posted on: 10-Jul-2019 09:21:06   

Otis, we will be migrating from 2.6 to the latest ones, and we are in a process of finding the costs etc to do so.

Since this is a big jump from 2.6 to 5.2, we are assuming there will be a few roadblocks and the migration work may take some time and I would not want any regular business as usual work to get impacted, hence I'm requesting you to help me out with modifying the drivers etc for 2.6 to work with sql server 2016. This is just going to be an interim solution till the time we are completely on the latest 5.x version.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Jul-2019 10:04:26   

The sourcecode archive, available from the v2.6 'extras' section, contains the 'drivers' solution. Open the .sln in visual studio and remove all projects except the SQL Server driver project. In that project you'll find a couple of .cs files. It has a SqlServerDBDriver, SqlServerCatalogRetriever and a SqlServerSchemaRetriever, among other files. These 3 are the ones you have to make some changes to. In v2.6 it uses in some methods a switch/case statement that selects a query based on the version of the database. It makes the wrong selection if the version is too high, so you have to adjust these switch statements to make sure it selects the 2008 query.

To compile the dll, remove the strong key reference (as that's not included) from the assemblyinfo.cs file and add a custom one yourself. This should make you be able to connect to newer sql server versions.

Frans Bouma | Lead developer LLBLGen Pro
Vivek30
User
Posts: 33
Joined: 30-Jun-2016
# Posted on: 10-Jul-2019 11:09:45   

Can't find any code archives, can you rather give me the link which I can just click and get the code? Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 10-Jul-2019 11:30:03   

My Account -> Downloads -> v2.6 -> Extras -> LLBLGen Pro SDK. The file contains all sourcecode we ship for the system.

I referred to source code archive, but forgot that in the v2.6 era it was bundled with the SDK simple_smile

Frans Bouma | Lead developer LLBLGen Pro
BarbC
User
Posts: 10
Joined: 01-Jun-2016
# Posted on: 10-Feb-2021 15:00:40   

Hello,

I apologize but I have gotten lost trying to follow this post. I need some clear instructions on what to do.

I have LLBLGen Pro 2.6 and I need to refresh my catalog from a SQLServer 2016 server (we recently upgrade).

I'm not clear what to download and where to put it.

After I get it in the right place - should it magically work - or do I need to run something?

Thanks for your assistance as I am lost right now.

Barb

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 10-Feb-2021 18:58:53   

As explained a couple of messages earlier You need to rebuild the driver and replace the one already shipped. The above message explains what exactly you need to change in the source code, basically a couple of switch cases.

BarbC
User
Posts: 10
Joined: 01-Jun-2016
# Posted on: 10-Feb-2021 19:37:24   

Thank you for pointing me to the right post.

I opened the Drivers solution - removed all projects except SQLServer and updated the .cs files to reference SQLServer 2016 corectly.

I also remove the strong key in the assemblyInfo.cs. I don't know how to create a new one to add. Can you assist with that.

I was able to rebuild the solution (I had to remove a Post Build event command to get it to compile)

I then copied the DLL that was created (from the bin directory) over to my installation directory in the Drivers folder to replace the current file.

Now I am getting this when I try to open my LLBLGEN Project

Could not load file or assembly 'file:///C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\Drivers\SqlServer\SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

I made the changes in visual studio 2017 -- is that the problem? I don't have an older version of visual studio on my computer to use. Is there any way around this? Does this have anything to do with the strong key?

Thanks

BarbC
User
Posts: 10
Joined: 01-Jun-2016
# Posted on: 10-Feb-2021 19:39:59   

BarbC wrote:

Thank you for pointing me to the right post.

I opened the Drivers solution - removed all projects except SQLServer and updated the .cs files to reference SQLServer 2016 corectly.

I also remove the strong key in the assemblyInfo.cs. I don't know how to create a new one to add. Can you assist with that.

I was able to rebuild the solution (I had to remove a Post Build event command to get it to compile)

I then copied the DLL that was created (from the bin directory) over to my installation directory in the Drivers folder to replace the current file.

Now I am getting this when I try to open my LLBLGEN Project

Could not load file or assembly 'file:///C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\Drivers\SqlServer\SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

I made the changes in visual studio 2017 -- is that the problem? I don't have an older version of visual studio on my computer to use. Is there any way around this? Does this have anything to do with the strong key?

Thanks

BarbC
User
Posts: 10
Joined: 01-Jun-2016
# Posted on: 10-Feb-2021 19:40:26   

My apologies -- no sooner did I post this - I figured it out. I changed the .net version back to 3.5 and then it worked.

1  /  2