Migrating from 2.5 to 2.6

Posts   
 
    
changomarcelo avatar
Posts: 62
Joined: 15-Feb-2007
# Posted on: 29-Oct-2009 20:54:36   

Hi, I'm migrating a project from 2.5 (target plataform 2.0) to 2.6 (target 3.5).

I had some SupportsSorting properties set to true in some of my collections but now that property seems not to be supported any more.

Here's a sample of old code:

        public static ClienteCollection GetClientes()
        {
            ClienteCollection clientes = new ClienteCollection();
            clientes.SupportsSorting = true;
            ISortExpression sort = new SortExpression(SortClauseFactory.Create(ClienteFieldIndex.RazonSocial, SortOperator.Ascending));
            clientes.GetMulti(null, 0, sort);
            return clientes;
        }

How should I migrate that?

Thanks!

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 29-Oct-2009 22:08:05   

I'm surprised you get this going from 2.5 to 2.6. We had some instances of this going from 1.x to 2.x. SupportsSorting is a read only property on the IBindingList interface which is implemented by the collection's DefaultView property.

It is true by default so does not need to be set.

Have a search of the forums for "SupportsSorting" in thread subject - there are several discussions about it.

Matt

changomarcelo avatar
Posts: 62
Joined: 15-Feb-2007
# Posted on: 29-Oct-2009 22:20:13   

I have decided not to do this migration because it was too much code to modify.

So I decided to installa LLBLGen Pro 2.5 to generate the code in the old format.

Now I'm having the following issues.

When I want to refresh the catalogue I get the following error:

ExecuteReader: CommandText property has not been initialized

Stack Trace:

-----[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 SD.LLBLGen.Pro.Gui.Forms.MainWindow.OnProjectExplorerCatalogRefreshClicked(Object sender, CatalogRefreshEventArgs e) at SD.LLBLGen.Pro.Gui.Forms.ProjectExplorer._menuItemCatalogRefreshUnattended_Click(Object sender, EventArgs e) 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.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met) at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met) 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.ScrollableControl.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.OnMessage(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)

Source: System.Data

changomarcelo avatar
Posts: 62
Joined: 15-Feb-2007
# Posted on: 29-Oct-2009 22:34:29   

Some more info:

  • My current database is SQL Server 2008. I don't know it this has something to do, but the original LLBLGen Pro project was created from a SQL Server 2005 database.
  • I'm running Windows 7
daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 30-Oct-2009 02:15:13   

Are you sure you are using the latest LLBLGen Pro v2.5 build? I have the same setup over here (SQL2008 + W7 + LLBLGen v2.5 | v2.6) and it's working.

BTW, I would recommend you to upgrade to v2.6. Going from v2.5 to v2.6 is not that hard. Here is a guide. I just moved some projects from v2.0 to v2.6 and it took me about four hours.

David Elizondo | LLBLGen Support Team