pandian

Hello all in the starter site credit card mangement page, i can able to add 6 credit cards. After that if try to add a new credit card it shows the following exception.

Error Message : Exception has been thrown by the target of an invocation.

Error InnerException :

Error Source : mscorlib

Error Stack Trace : at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)

at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method)

at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteInsert(IDictionary values)

at System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback)

at System.Web.UI.WebControls.FormView.HandleInsert(String commandArg, Boolean causesValidation)

at System.Web.UI.WebControls.FormView.InsertItem(Boolean causesValidation)

at Controls_PaymentManager.EditButton_Command(Object sender, CommandEventArgs e)

Is there any restriction

How many credit cards i can able to add

Please let me know the solution.

Thanks in Advance.

Thanks

-Pandi.



Re: Commerce Server 2007 Exception while add new credit card

William Hickson

The credit card id's and address id's are stored in a list within the UserObject. These lists have a default data type of nvarchar(255). To be able to store more than 6 you'll need to modify the size of these columns in the database and the maxlength property in the profile definition in CS Manager.

I don't understand why CS does it this way. Why would anyone store relationships by building a list in the parent row fo the database instead of a foreign key in the child It turns database design on it's head and incurrs the problem you have run into. I'd love to hear an explanation for why CS was designed this way.





Re: Commerce Server 2007 Exception while add new credit card

pandian

Could u please tell me how to increase the size in commerce server. I can see the maxlength in custom properties and how can i edit that.





Re: Commerce Server 2007 Exception while add new credit card

William Hickson

You use the Commerce Server Manager to maintain the profile definitions. In the lefthand tree view expand the Global resources, the Profiles for your site, the profile Catalog and Profile Definitions until you get to the User Oject. On the right hand pane under General Information you'll find the properties you need to change. The maximum size for the profile properties are under custom attributes of the properties. If you have multiple copies of your site you'll want to apply the same schema changes and profile changes to these other sites as well. You can also export the profile definition and import it into the other sites. The schema changes will have to be applied in both approaches.

For more information refer to the Developing with the Profiles System in the online CS2007 dosumentation.