"There is no key field defined in the UI component" ?
 
CapableObjects Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



"There is no key field defined in the UI... Expand / Collapse
Author
Message
Posted 2009-04-23 23:26:34


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2009-06-27 19:05:52
Posts: 64, Visits: 353
Asp.Net content form with a DataGridView - ExternalID and an AutoInc I added are there.  Let's me Edit a record but I get this when I hit the "Update" grid command column.. ran through QuickStart7(asp.net) and couldn't see any missed steps.  I tried removing the class's associations, regernated model, vallidated model, regenerated db scema(SQLServer2005), rebuilt solution..err still there.  Restarted VS2008 - err still there on update.

Anyone else see this?  Doesn't the EcoDataSource take care of the PK?

[ArgumentException: There is no key field defined in the UI component]
   Eco.Web.UI.WebControls.EcoDataSourceView.GetObject(IDictionary keys) in e:\dev\fbuild\source\Eco\Eco.Web\EcoDataSourceView.cs:868
   Eco.Web.UI.WebControls.EcoDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) in e:\dev\fbuild\source\Eco\Eco.Web\EcoDataSourceView.cs:814
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92
   System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +907
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +704
   System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

- Joe Hendricks SoftwareRunnersLife On Glen Cove

Post #3117
Posted 2009-04-24 04:19:41


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2009-06-27 19:05:52
Posts: 64, Visits: 353
Uninstalled latest field test, reinstalled EcoSetup_5.0.0.3854_2009-03-07_b690, restarted computer.. 

Started a new ECO5 asp.net/xml persistence app with Class1/Attribute1 and now get this WEIRD error:

Server Error in '/' Application.
--------------------------------------------------------------------------------
Key must consist of ExternalId only
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.ArgumentException: Key must consist of ExternalId only
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:
[ArgumentException: Key must consist of ExternalId only]
   Eco.Web.UI.WebControls.EcoDataSourceView.GetObject(IDictionary keys) in e:\dev\fbuild\source\Eco\Eco.Web\EcoDataSourceView.cs:869
   Eco.Web.UI.WebControls.EcoDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) in e:\dev\fbuild\source\Eco\Eco.Web\EcoDataSourceView.cs:814
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +92
   System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +907
   System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +704
   System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
   System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

- Joe Hendricks SoftwareRunnersLife On Glen Cove

Post #3119
Posted 2009-04-28 12:05:27
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 2010-08-23 23:54:43
Posts: 1 228, Visits: 1 374
Normally the EcoDataSource will be configured so that it adds a key column called "ExternalId", and when you connect a gridview or some other databound control to this datasource, it should set its DataKeyNames property to "ExternalId". If this property is changed to some other value, you will get an exception when you try to perform an update from the component since the Datasource can't tell which row you updated.

/Jonas Hogstrom [CapableObjects]
Post #3149
Posted 2009-04-28 15:50:12


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2009-06-27 19:05:52
Posts: 64, Visits: 353
Jonas Hogstrom (2009-04-28)
Normally the EcoDataSource will be configured so that it adds a key column called "ExternalId", and when you connect a gridview or some other databound control to this datasource, it should set its DataKeyNames property to "ExternalId". If this property is changed to some other value, you will get an exception when you try to perform an update from the component since the Datasource can't tell which row you updated.

Nothing manually changed at all, ExternalID is there - the second time it happened I was using the default Class1/Attribute1 right after starting a new ECO5 solution w/xml persistence, generating model code, building solution, running xml autoforms.  Edit works fine, but update does not. 

- Joe Hendricks SoftwareRunnersLife On Glen Cove

Post #3157
Posted 2009-04-30 00:08:00


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: 2009-06-27 19:05:52
Posts: 64, Visits: 353
Uninstalled, reinstalled VS2008 w/all updates - reinstalled ECO5 - FIXED !!

So, I guess my VS was the issue, sigh.

- Joe Hendricks SoftwareRunnersLife On Glen Cove

Post #3168
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: HansKarlsen, Jonas Hogstrom

Permissions Expand / Collapse

All times are GMT +1:00, Time now is 8:45

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0,328. 12 queries. Compression Disabled.