I created a business object and mapped it to a view. When I tried to add record, an error occured. The error message as below BusinessLayerException
An error occurred while saving an the data to the server.
DataLayerSavingException
Cannot create INSERT command because the updating DataTable does not contain columns for all PrimaryKeyFields.
DataLayerException
Cannot create INSERT command because the updating DataTable does not contain columns for all PrimaryKeyFields.
Source : MicroFour StrataFrame Business
Stack Trace:
at MicroFour.StrataFrame.Data.DataLayer.BuildInsertInfo(DataTable UpdatingTable, Boolean Transactional, String TransactionKey)
.
.
.
I manually assigned one of the fields from the view to be the primary key. I changed the code in Business Object, Private Shared _PrimaryKeyFields As String() = New String() {""} to Private Shared _PrimaryKeyFields As String() = New String() {"customerId"}.
After that I can add and update the records using that business object. Is this the correct way to do it? Will it cause any problem?