Forum:  Designer

Thread:  LLBLGen Pro 2.6 with SQL Server 2016


Kaustubh (User)   Posted on: 02-Mar-2017 14:49:26.
Hello,

Recently we have upgraded our SQL server from 2014 to 2016. But we are getting following exception in catalog refresh,

Message:
ExecuteReader: CommandText property has not been initialized

Stacktrace:
-----[Core exception]--------------------
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at SD.LLBLGen.Pro.DBDrivers.SqlServer.SqlServerCatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags)
at SD.LLBLGen.Pro.DBDrivers.SqlServer.SqlServerDBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties)
at SD.LLBLGen.Pro.Gui.Forms.MainWindow.RefreshCatalogs(Boolean unattended, Hashtable catalogsToRefresh)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

We are using LLBLGen Pro version 2.6.

Please let me know how can I update the sql driver for SQL Server 2016

Thanks in advance.

-Kaustubh
Walaa (Support Team)   Posted on: 03-Mar-2017 04:27:34.
You will need to modify the driver.
You can find the source code at (Downloads-> v2.6-> extras section) in the "LLBLGen Pro SDK" package.

In code look for _majorSqlServerVersion, you will know what to do. Just add the 2016 version number and maybe the 2014 too.


Otis (LLBLGen Pro Team)   Posted on: 03-Mar-2017 11:10:33.
... or upgrade to v5 which has support for 2016 built-in, including 2016 specific features Wink
Kaustubh (User)   Posted on: 03-Mar-2017 12:12:41.
Yes Otis, we are planning to upgrade to v5. But meanwhile can you please share the link where I can download the source code that Walaa has suggested in his post. Or can you share the 2016 specific dll?

Regards,
Kaustubh


Walaa (Support Team)   Posted on: 03-Mar-2017 13:42:49.
The path I described above is under "My Account/Downloads/v.2.6"
You should sign in to the website using your CustomerID, then go to the following URL.

Here is a direct path, to this section of the downloads.
http://www.llblgen.com/pages/secure/ListDownloads.aspx?ProductVersion=6
Kaustubh (User)   Posted on: 14-Mar-2017 16:58:31.
Hello Otis and Walaa,

I have downloaded the sourcecode from link mentioned in last post, but the source code is not getting built. I am getting missing assembly reference error. Please find attached screenshot Missingdll.jpeg.

Also please let me know exactly what changes need to make in _majorSqlServerVersion, so that the dll will support SQL server 2014.

Looking forward to here from you as soon as possible.

Thanks in advance.

Regards,
Kaustubh



Kaustubh (User)   Posted on: 14-Mar-2017 17:59:56.
Hello Otis and Walaa,

I have resolved the missing assembly reference error by adding the ddls from LLBLGen Pro installation folder.

Now I am getting the following error,
Error    43    Cryptographic failure while signing assembly 'd:\Projects\FurstPerson\FP_Shared_Folder\LLBLGenPro-v2.6-setup\LLBLGenProSDK_09132012\Sourcecode\Drivers\SqlServer\obj\Debug Demo\SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll' -- 'Error reading key file 'C:\Myprojects\mystrongkey.key' -- The system cannot find the path specified. '    D:\Projects\FurstPerson\FP_Shared_Folder\LLBLGenPro-v2.6-setup\LLBLGenProSDK_09132012\Sourcecode\Drivers\SqlServer\CSC

Also please let me know what code level changes are required.

Regards,
Kaustubh
Walaa (Support Team)   Posted on: 14-Mar-2017 18:06:41.
7,8,9,10....13 are the major version numbers as shown in the following blog post.
https://sqlserverbuilds.blogspot.com.eg/
Just search the source code, and add extra conditions for the major version that you need.

(EDIT)
Comment the signing code in the Open AssemblyInfo.cs






DG (User)   Posted on: 16-Jun-2017 11:02:21.
Kaustubh wrote:
Yes Otis, we are planning to upgrade to v5. But meanwhile can you please share the link where I can download the source code that Walaa has suggested in his post. Or can you share the 2016 specific dll?

Regards,
Kaustubh


We had the same problem, I changed the dll.

This attached dll works with LLBL gen v2.6 it's solves the commandtext not initialised error for MSSQL version 2016, 2012

just overwrite the attached dll: SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll
in folder:
C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\Drivers\SqlServer

Then the error is gone.
Good Luck

(edit) No binaries from 3rd parties allowed, sorry. -- Otis
Otis (LLBLGen Pro Team)   Posted on: 17-Jun-2017 09:46:17.
This is a bit of a catch 22: you attached a binary file, but it can contain anything, and as it's on our forums we are responsible for this and therefore can't let others download it. Attaching the source code however is prohibited, as it's not source that's open.

So if you want to share things, I think the best thing you can do is create a diff file with the changes made and attach that so others can apply that diff to the source they download from our website.


priller (User)   Posted on: 25-Apr-2018 16:26:39.
Can I get the SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll emailed to me that works with SQL Server 2016 and 2.6 please? I can give you my customer id etc.    Thanks
Otis (LLBLGen Pro Team)   Posted on: 25-Apr-2018 17:21:40.
No, as that driver doesn't exist. You have to adjust the driver source yourself.

Saurabh095 (User)   Posted on: 21-Jun-2019 12:54:41.
Hello,

Recently we have upgraded our SQL server from 2008 to 2016. But we are getting following exception in catalog refresh,

Message:
ExecuteReader: CommandText property has not been initialized

Stacktrace:
-----[Core exception]--------------------
at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at SD.LLBLGen.Pro.DBDrivers.SqlServer.SqlServerCatalogRetriever.RetrieveSchemas(String connectionString, IDBCatalog catalogToRetrieve, SchemaFetchFlags fetchFlags)
at SD.LLBLGen.Pro.DBDrivers.SqlServer.SqlServerDBDriver.PopulateSelectedCatalogs(Hashtable callBacks, Hashtable connectionElements, SchemaFetchFlags fetchFlags, Hashtable properties)
at SD.LLBLGen.Pro.Gui.Forms.MainWindow.RefreshCatalogs(Boolean unattended, Hashtable catalogsToRefresh)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

We are using LLBLGen Pro version 2.6.

Please let me know how can I update the sql driver for SQL Server 2016 or
can I get the SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll emailed to me that works with SQL Server 2016 and 2.6 please?

Thanks in advance.
Saurabh
Saurabh095 (User)   Posted on: 21-Jun-2019 13:03:20.
DG wrote:
Kaustubh wrote:
Yes Otis, we are planning to upgrade to v5. But meanwhile can you please share the link where I can download the source code that Walaa has suggested in his post. Or can you share the 2016 specific dll?

Regards,
Kaustubh


We had the same problem, I changed the dll.

This attached dll works with LLBL gen v2.6 it's solves the commandtext not initialised error for MSSQL version 2016, 2012

just overwrite the attached dll: SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll
in folder:
C:\Program Files (x86)\Solutions Design\LLBLGen Pro v2.6\Drivers\SqlServer

Then the error is gone.
Good Luck

(edit) No binaries from 3rd parties allowed, sorry. -- Otis


Hello,

Can you please send me the dll for change

Thanks
Saurabh


Walaa (Support Team)   Posted on: 21-Jun-2019 14:30:37.
This should be simple as explained above.
Just get the source code and follow the couple of steps mentioned here.
Saurabh095 (User)   Posted on: 25-Jun-2019 10:10:43.
Hi Walaa,

I am using the trial version of the llblgenpro v5 and generating the entity class file but it is not creating the entity for the tables. please help me on this

Thanks
Saurabh


pjoshidxt (User)   Posted on: 25-Jun-2019 10:22:15.
I am also facing the same issue. Can someone help on this please?
It has created DatabaseGeneric folder and under it (EntityClasses folder) but there is only one class file i.e CommonEntityBase.cs.
Walaa (Support Team)   Posted on: 25-Jun-2019 17:26:32.
pjoshidxt wrote:
I am also facing the same issue. Can someone help on this please?
It has created DatabaseGeneric folder and under it (EntityClasses folder) but there is only one class file i.e CommonEntityBase.cs

That's a completely different subject, please create a new thread for it.


Vivek30 (User)   Posted on: 08-Jul-2019 12:35:58.
Hi,

I'm migrating from 2008 R2 to 2016. But when I'm creating new project and trying to connect, the llblgenpro is doing no action. I'm unable to see any items in "Catalogs found" grid and the "Create" button is disabled too. Is there a place where I can see the logs or anything else that is know while upgrading sql server from 2008 to 2016 using llblgenpro2.6

Regards,
Vivek
Otis (LLBLGen Pro Team)   Posted on: 08-Jul-2019 14:57:36.
vs version doesn't have an influence. v2.6 is out of support anyway.

Vivek30 (User)   Posted on: 08-Jul-2019 16:22:57.
I'm migrating from 2008 R2 to 2016. But when I'm creating new project(using llblgen pro designer) and trying to connect, the llblgenpro is doing no action. I'm unable to see any items in "Catalogs found" grid and the "Create" button is disabled too. Is there a place where I can see the logs or anything else that is know while upgrading sql server from 2008 to 2016 using llblgenpro2.6
Otis (LLBLGen Pro Team)   Posted on: 08-Jul-2019 16:48:24.
v2.6 doesn't work with sqlserver 2016 (v2.6 was released in 2008, 11 years ago, it has some unfortunate query construction where newer sqlserver versions don't work anymore. v3+ addresses that).

So you have to adjust the driver code yourself to make it work or upgrade to a later version of llblgen pro. THe latter is recommended as since v2.6 we made the runtime much much faster and added a lot of features you might need.


DG (User)   Posted on: 09-Jul-2019 09:40:01.
Otis wrote:
v2.6 doesn't work with sqlserver 2016 (v2.6 was released in 2008, 11 years ago, it has some unfortunate query construction where newer sqlserver versions don't work anymore. v3+ addresses that).

So you have to adjust the driver code yourself to make it work or upgrade to a later version of llblgen pro. THe latter is recommended as since v2.6 we made the runtime much much faster and added a lot of features you might need.

Actually this is not true, we are running LLBLGen 2.6 on SQL 2017 server, with compatibility mode 140, and this works fine. In the mean time we are porting our software to Entity Framework. Also I am tired that LLBLgen moderators not make the adapted DLL available for their customers.
Vivek30 (User)   Posted on: 09-Jul-2019 10:33:54.
DG and Otis many thanks. We are planning to upgrade llblgen pro to latest version for which I want to know the costing model.

In the interim I dont want to put a hard stop for our development work, so any help in adjusting the driver code to make this work for a month or so is what I am looking for. Can you guide me through so that I can give that a go? Just to me more clear the existing entities generated from llblgenpro 2.6 is successfully able to connect to sql server 2016, the problem is only when I try to refresh the .lgp file to get new schema the designer doesnt show any catalog.


Otis (LLBLGen Pro Team)   Posted on: 09-Jul-2019 21:12:48.
DG wrote:
Otis wrote:
v2.6 doesn't work with sqlserver 2016 (v2.6 was released in 2008, 11 years ago, it has some unfortunate query construction where newer sqlserver versions don't work anymore. v3+ addresses that).

So you have to adjust the driver code yourself to make it work or upgrade to a later version of llblgen pro. THe latter is recommended as since v2.6 we made the runtime much much faster and added a lot of features you might need.

Actually this is not true, we are running LLBLGen 2.6 on SQL 2017 server, with compatibility mode 140, and this works fine.

That's the runtime. The driver doesn't work with sqlserver 2017. I know, because I wrote it.

Quote:

In the mean time we are porting our software to Entity Framework. Also I am tired that LLBLgen moderators not make the adapted DLL available for their customers.

Well, if you want to move to entity framework instead of staying on a framework that has more features and is many times faster, that's of course your choice. However I don't see why we have to actively backport features to a version that's 11 years old? Do you backport features to your software that you wrote 11 years ago? I don't think so.

It's not hard though. We provide the sourcecode for this to our customers. If you really want to stay on an unsupported version that's 11 years old because you don't want to pay for a newer version and support, then you can adjust the driver yourself. Not many companies do that.
Vivek30 (User)   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 (LLBLGen Pro Team)   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.
Vivek30 (User)   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 (LLBLGen Pro Team)   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 Regular Smiley