Schema meta data retrieval failed / InvalidOperationException / CommandText property not initialized

Posts   
 
    
Posts: 14
Joined: 14-Jan-2009
# Posted on: 17-Sep-2012 06:52:37   

Running v3.1 Final March 12th, 2012 Win7 x64 Ultimate MacOS / VMWare Fusion Microsoft SQL Server Developer (64-bit) 11.0.2100.60

I have opened a LLBLGen Project file and I'm trying to refresh the schema and I'm getting some errors. Now this works fine on my desktop which is running SQL Server 2008 and Win7 x64 on regular workstation (i.e. not a Mac). I'm thinking the issue is with the latest version of SQL Server or VMWare?

Steps to reproduce:

I right click the "SQL Server (SqlClient)" in the Catalog Explorer. Refresh... Test Connection... (succeeded!) Click "Next >"

Exception information.
=============================================================
LLBLGen Pro version: v3.1. Build: March 12th, 2012

Exception details:
=====================
Message: ExecuteReader: CommandText property has not been initialized
Source: System.Data
Stack trace: 
   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.SqlServerDBDriver.GetAllSchemaNames(String catalogName) in C:\Myprojects\VS.NET Projects\LLBLGen Pro v3.1\Drivers 3.1\SqlServer\SqlServerDBDriver.cs:line 547
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.PopulateCatalog(TreeNode nodeToPopulate, TagEntry`1 tagData)

Inner exception: <null>

-----------------------------------------------

Click OK...

--------------------------------------------
Exception information.
=============================================================
LLBLGen Pro version: v3.1. Build: March 12th, 2012

Exception details:
=====================
Message: Specified argument was out of the range of valid values.
Parameter name: index
Source: System.Windows.Forms
Stack trace: 
   at System.Windows.Forms.TreeNodeCollection.get_Item(Int32 index)
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.PreCheckAndExpandExistingElementsForRefresh()
   at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.FillControls()
   at SD.LLBLGen.Pro.Gui.Forms.MetaDataRetrievalWizard._mainWizardControl_SelectedPageChanging(Object sender, WizardPageChangingEventArgs e)
   at DevExpress.XtraWizard.WizardControl.RaiseSelectedPageChanging(BaseWizardPage oldPage, BaseWizardPage newPage, Direction direction)
   at DevExpress.XtraWizard.WizardControl.SetSelectedPageCore(BaseWizardPage prevPage, BaseWizardPage value, Direction direction)
   at DevExpress.XtraWizard.WizardControl.SetNextPage()
   at DevExpress.XtraWizard.WizardControl.OnNextButtonClick(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e)
   at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at DevExpress.Utils.Controls.ControlBase.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)

Inner exception: <null>


Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 17-Sep-2012 11:55:53   

I think it's about the sqlserver version, which is sqlserver 2012, and v3.1 doesn't have support for that. Could you upgrade to v3.5 (free upgrade) which supports sqlserver 2012?

The driver of 3.1 doesn't contain proper switches for sqlserver 2012. I'll add those and add a new build to this thread, but it's better to go for v3.5 anyway, it shouldn't take much effort to migrate your code to v3.5.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 17-Sep-2012 12:49:59   

Attached is an updated driver. Could you try that one please? (copy as administrator into the folder <installation folder>\Drivers\SQL Server )

Attachments
Filename File size Added on Approval
SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll 94,208 17-Sep-2012 12:50.11 Approved
Frans Bouma | Lead developer LLBLGen Pro
Posts: 14
Joined: 14-Jan-2009
# Posted on: 18-Sep-2012 08:10:43   

Otis wrote:

Attached is an updated driver. Could you try that one please? (copy as administrator into the folder <installation folder>\Drivers\SQL Server )

Works as expected. Incredible service - thank you Frans.

epiazza
User
Posts: 4
Joined: 09-Sep-2008
# Posted on: 06-Feb-2013 02:39:46   

Is there any chance you could provide an updated driver for version 3.0?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 06-Feb-2013 10:34:30   

epiazza wrote:

Is there any chance you could provide an updated driver for version 3.0?

Well, it's not impossible to create of course, but we've more or less halted creating fixes for v3.0 for two reasons:

1) 3.0 is pirated a lot 2) 3.1 has almost no breaking changes and contains a lot of fixes

3.1 is a free upgrade, has no breaking changes to speak of (a few minor ones, you'll very likely not run into those, see: http://www.llblgen.com/documentation/3.1/LLBLGen%20Pro%20RTF/hh_goto.htm#migratingcode.htm), and is actively receiving fixes, when required.

If you really must, and there's no way you can upgrade to v3.1, then we'll provide you a new driver, however we're encouraging you to migrate to at least 3.1. 3.5 is recommended, but has a few more breaking changes.

The SQL Server 2012 support for the driver is easy to add to the driver sourcecode, it's a matter of adding the version numbers to the switch statements in the driver code (as that code still didn't have a fall-back system which always works).

In v3.5 we also added SQL Server 2012 paging code to the runtime, which isn't present in 3.1 nor 3.0. We won't backport that in any occasion. So in 3.0/1 you'll have to use the CTE based paging code for 2005 and up. It's not that important but it could be less efficient than the 2012 paging code which uses the fetch/offset syntax.

We didn't implement 2012 sequence support in v3.x, as there wasn't any time for that. So the driver updates will solely switch to the right query to pull the meta-data.

So tl;dr: please upgrade to v3.1 and if possible to 3.5, if you can't do that or you're forbidden by your client, let us know and we'll backport it to v3.0.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 06-Feb-2013 19:16:18   

Attached is the driver for v3.0 for SQL Server to obtain meta-data from SQL Server 2012.

Attachments
Filename File size Added on Approval
SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll 94,208 06-Feb-2013 19:16.26 Approved
Frans Bouma | Lead developer LLBLGen Pro
Lazar Sebi
User
Posts: 5
Joined: 04-Dec-2014
# Posted on: 04-Dec-2014 11:51:45   

Otis wrote:

Attached is an updated driver. Could you try that one please? (copy as administrator into the folder <installation folder>\Drivers\SQL Server )

I have the same issue that started this thread, but with SQLServer 2014. LlBlGen v. 3.1 Final - February 7th, 2011 (Releasesed on)

I have upgraded the sql server from SqlServer 2008R2 to SqlServer 2014 ( 12.0.2000.8 ) When i try to Refresh The Relational Model, the testing of the connection to the Sql Server works, but, when hitting next i get the bellow error:

Exception information.

LLBLGen Pro version: v3.1. Build: February 7th, 2011

Exception details:

Message: ExecuteReader: CommandText property has not been initialized Source: System.Data Stack trace: 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.SqlServerDBDriver.GetAllSchemaNames(String catalogName) at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.PopulateCatalog(TreeNode nodeToPopulate, TagEntry`1 tagData)

Inner exception: <null>

After Pressing ok i get a seccond error:

Exception information.

LLBLGen Pro version: v3.1. Build: February 7th, 2011

Exception details:

Message: Specified argument was out of the range of valid values. Parameter name: index Source: System.Windows.Forms Stack trace: at System.Windows.Forms.TreeNodeCollection.get_Item(Int32 index) at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.PreCheckAndExpandExistingElementsForRefresh() at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.FillControls() at SD.LLBLGen.Pro.Gui.Forms.MetaDataRetrievalWizard._mainWizardControl_SelectedPageChanging(Object sender, WizardPageChangingEventArgs e) at DevExpress.XtraWizard.WizardControl.RaiseSelectedPageChanging(BaseWizardPage oldPage, BaseWizardPage newPage, Direction direction) at DevExpress.XtraWizard.WizardControl.SetSelectedPageCore(BaseWizardPage prevPage, BaseWizardPage value, Direction direction) at DevExpress.XtraWizard.WizardControl.SetNextPage() at DevExpress.XtraWizard.WizardControl.OnNextButtonClick(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e) at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at DevExpress.Utils.Controls.ControlBase.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)

Inner exception: <null>

I have tried the dll from this posts, which says it works for SqlServer 2012, but i get the same errors, and i am not able to do the refresh.

Can anybody help me with this issue ? For the moment updating llblgen to v 3.5 or 4.2 is not possible.

Thank you in advance. Sebi.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 04-Dec-2014 12:01:04   

download the latest v3.1 build from the customer area and try again.

Frans Bouma | Lead developer LLBLGen Pro
Lazar Sebi
User
Posts: 5
Joined: 04-Dec-2014
# Posted on: 04-Dec-2014 13:41:46   

I've installed llbl gen 3.1 Build March 12th 2012, copied the DLL from post: 17-Sep-2012 12:49:59, and tried a refresh. I get the same errors still:

Exception information.

LLBLGen Pro version: v3.1. Build: March 12th, 2012

Exception details:

Message: ExecuteReader: CommandText property has not been initialized Source: System.Data Stack trace: 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.SqlServerDBDriver.GetAllSchemaNames(String catalogName) at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.PopulateCatalog(TreeNode nodeToPopulate, TagEntry`1 tagData)

Inner exception: <null>

and

Exception information.

LLBLGen Pro version: v3.1. Build: March 12th, 2012

Exception details:

Message: Specified argument was out of the range of valid values. Parameter name: index Source: System.Windows.Forms Stack trace: at System.Windows.Forms.TreeNodeCollection.get_Item(Int32 index) at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.PreCheckAndExpandExistingElementsForRefresh() at SD.LLBLGen.Pro.Gui.Controls.WizardPages.MetaDataRetrievalWizard_Step_ElementSelection.FillControls() at SD.LLBLGen.Pro.Gui.Forms.MetaDataRetrievalWizard._mainWizardControl_SelectedPageChanging(Object sender, WizardPageChangingEventArgs e) at DevExpress.XtraWizard.WizardControl.RaiseSelectedPageChanging(BaseWizardPage oldPage, BaseWizardPage newPage, Direction direction) at DevExpress.XtraWizard.WizardControl.SetSelectedPageCore(BaseWizardPage prevPage, BaseWizardPage value, Direction direction) at DevExpress.XtraWizard.WizardControl.SetNextPage() at DevExpress.XtraWizard.WizardControl.OnNextButtonClick(Object sender, EventArgs e) at System.Windows.Forms.Control.OnClick(EventArgs e) at DevExpress.XtraEditors.BaseButton.OnClick(EventArgs e) at DevExpress.XtraEditors.BaseButton.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at DevExpress.Utils.Controls.ControlBase.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)

Inner exception: <null>

Is there anything else that you suggest i could try to make this work?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 04-Dec-2014 16:24:39   

the problem is the sqlserver driver isn't anticipating on a version number > the one in sqlserver 2012. We updated this code in 3.5 so it won't fail with newer versions. We'll see what we can do for 3.1 in this case (it's not that hard to fix, there are a couple of switch/cases to select between different meta-data queries depending on the version of the database)

Frans Bouma | Lead developer LLBLGen Pro
Lazar Sebi
User
Posts: 5
Joined: 04-Dec-2014
# Posted on: 05-Dec-2014 09:05:31   

The application for which we are using the llblgen is in production. There is a bit of pressure in handling it as soon as possible. Do you think there is a possibility to get this fix soon? Because otherwise we have to start investigating the impact of updating the llblgen version to 3.5 in our application. We are already somehow behind schedule because of it. If you cannot help us with a new dll in a short time frame, we will appreciate greatly if you could tell us where should we do the changes in the source code of the sql DLL, and what would those changes be?

Thank you very much for your help and your quick replies.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 05-Dec-2014 09:55:34   

upgrading to at least v3.5 is IMHO something you should do anyway, but I can understand it's a problem if you just want to get your project finished, as migrating takes time due to some breaking changes.

fixing the driver isn't that hard, so you'll have a fixed driver at the end of the day.

Frans Bouma | Lead developer LLBLGen Pro
Lazar Sebi
User
Posts: 5
Joined: 04-Dec-2014
# Posted on: 05-Dec-2014 10:08:18   

Thank you very much for your help. We will plan an upgrade as soon as the project permits it.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 05-Dec-2014 10:57:43   

See attached driver (which is a release build). v3.5 should work with 2014 out of the box. The driver file should be copied as administrator (!) to <llblgen pro installation folder>\Drivers\SQL Server, overwriting the old one.

For the runtime you don't need a fix, the runtime works fine with 2014.

Attachments
Filename File size Added on Approval
SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll 90,112 05-Dec-2014 10:57.59 Approved
Frans Bouma | Lead developer LLBLGen Pro
Lazar Sebi
User
Posts: 5
Joined: 04-Dec-2014
# Posted on: 05-Dec-2014 13:20:37   

Thank you very much for your help. The refresh on SqlServer2014 Databases works now correctly for V 3.1.

Have a great weekend.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 05-Dec-2014 13:56:47   

you too simple_smile

Frans Bouma | Lead developer LLBLGen Pro
omnition
User
Posts: 3
Joined: 26-Sep-2016
# Posted on: 26-Sep-2016 11:06:06   

Hi,

I too am stuck on 2.6 and have downloaded the SD.LLBLGen.Pro.DBDrivers.SqlServerDBDriver.dll for 3.1. However, I can not find where to download the 3.1 install. Our "client site" only has the option for downloads of 2.6 and prior releases.

Where exactly do we download the 3.1 ?

Secondly, I downloaded the SDK and tried to update the case statement my self, just to see if it would work. It did not. I decompiled the sql 2012 working SqlServerDBDriver (http://www.llblgen.com/TinyForum/Attachments.aspx?SourceType=1&MessageID=120516) and noticed it was quite a bit different to the SDK.

Is the source available for the driver in http://www.llblgen.com/TinyForum/Attachments.aspx?SourceType=1&MessageID=120516 ?

Our client is now talking about upgrading to 2016. However, I get the feeling that even upgrading from 2.6 to 3.1 is not even going to be a viable option for us, so having the source for the driver would be great.

Thanks for you assistance.

Walaa avatar
Walaa
Support Team
Posts: 14951
Joined: 21-Aug-2005
# Posted on: 26-Sep-2016 18:36:47   

Why stuck on v.2.6? If you want to support recent databases, then I'd recommend you upgrade to v.5.

Next time please don't resurrect old threads, create a new one and reference the old ones. Thanks,

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39617
Joined: 17-Aug-2003
# Posted on: 26-Sep-2016 18:41:06   

You can download the source of the driver from the 'My Account' section (Downloads-> v2.6-> extras section) after you've logged in with your customerid and password.

Frans Bouma | Lead developer LLBLGen Pro