BUG - Ambiguous column name 'OrderId'.

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
SteelArt
Ensign (ENS)
Ensign (ENS)
Posts: 4
Joined: Wed May 18, 2011 3:41 pm

BUG - Ambiguous column name 'OrderId'.

Post by SteelArt » Thu Aug 04, 2011 8:28 pm

I am using AbleCommerce 7.0.7 build 14481

When I goto Ordrers > Payment Manager I get the error "Ambiguous column name 'OrderId'.

I have looked for a patch etc but no luck there. I am confident this is an Able Commerce issue as I haven't changed anything on there and the build has only been up for a month or so.


Stace Trace :

Server Error in '/' Application.
--------------------------------------------------------------------------------

Ambiguous column name 'OrderId'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Ambiguous column name 'OrderId'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): Ambiguous column name 'OrderId'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1953274
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849707
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +33
System.Data.SqlClient.SqlDataReader.get_MetaData() +96
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +141
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +12
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) +10
CommerceBuilder.Data.Database.a(DbCommand A_0, CommandBehavior A_1) +92
CommerceBuilder.Data.Database.ExecuteReader(DbCommand command) +100
CommerceBuilder.Search.PaymentFilter.Load(Int32 maximumRows, Int32 startRowIndex, String sortExpression) +1359
CommerceBuilder.Search.PaymentFilterDataSource.Load(PaymentFilter filter, Int32 maximumRows, Int32 startRowIndex, String sortExpression) +15

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +71
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +261
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +488
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +72
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4214; ASP.NET Version:2.0.50727.4209

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: BUG - Ambiguous column name 'OrderId'.

Post by Katie » Fri Aug 05, 2011 8:25 am

Hi there,

The latest service release for version 7.0.7 can be found at help.ablecommerce.com. Check the right column for latest news and information....

Here is a direct link to the download and change log -
http://help.ablecommerce.com/index.htm# ... ease_1.htm

I'm not certain if this specific error you are having will be resolved, so please keep us updated.

Thanks!
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

emedic
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Thu Sep 08, 2011 9:07 am

Re: BUG - Ambiguous column name 'OrderId'.

Post by emedic » Thu Sep 08, 2011 9:17 am

I am getting same error. My AC build is VERSION: 7.0.7.14600
This is the query that bombs out:
exec sp_executesql N'SELECT TOP 20 ac_Payments.PaymentId,ac_Payments.OrderId,ac_Payments.SubscriptionId,ac_Payments.PaymentMethodId,ac_Payments.PaymentMethodName,ac_Payments.ReferenceNumber,ac_Payments.Amount,ac_Payments.CurrencyCode,ac_Payments.PaymentDate,ac_Payments.PaymentStatusId,ac_Payments.PaymentStatusReason,ac_Payments.CompletedDate,ac_Payments.EncryptedAccountData,ac_Payments.ReCrypt
FROM ac_Payments
INNER JOIN ac_Orders ON ac_Payments.OrderId = ac_Orders.OrderId
WHERE ac_Orders.StoreId = @storeId
AND ac_Payments.PaymentStatusId = @paymentStatusId
ORDER BY OrderId DESC', N'@paymentStatusId smallint,@storeId int', @paymentStatusId = 2, @storeId = 1

So, ORDER BY clause should be fixed: ORDER BY ac_Orders.OrderId DESC
Can someone please change this query?
Thanks!

emedic
Ensign (ENS)
Ensign (ENS)
Posts: 2
Joined: Thu Sep 08, 2011 9:07 am

Re: BUG - Ambiguous column name 'OrderId'.

Post by emedic » Thu Sep 08, 2011 9:46 am

Did little digging - if you do not have time to wait for AC to fix this, open \Admin\Orders\PaymentManager.aspx
Look for: DefaultSortExpression="OrderId"
and change it to: DefaultSortExpression="ac_orders.OrderId"
Worked for me...

Post Reply