Kbase P125581: Moving Open Client application from .Net 1.1 to .Net 2.0 causes .Net required field left blank type
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/2/2008 |
|
Status: Verified
SYMPTOM(s):
Application makes heavy use of dynamic ProDataSets
Application receives .NET exceptions when trying to add a new record to a ProDataSet returned from the AppServer
.NET says that a field was left blank and it is required to have a value
Nothing in the .NET or 4GL code has changed (just recompiled)
FACT(s) (Environment):
OpenEdge 10.1B
Windows
CHANGE:
Migrated from OpenEdge 10.0B and .NET 1.1 to OpenEdge 10.1B and .NET 2.0
CAUSE:
In OpenEdge 10.0B, if a table within a ProDataSet had a primary key defined that information was not properly being passed back to .NET so the .NET DataSet would not have the primary key defined. In OpenEdge 10.1B this behavior was corrected so that the index information would be properly passed back to the .NET side.
FIX:
The .NET exception is accurate and does indicate a logic flaw in the application code. The two ways to resolve this are as follows:
1) Modify the ABL code and set the "unique-exp" and "primary-exp" parameters of the ADD-NEW-INDEX method to FALSE). This is a quick and dirty workaround to the problem which will allow you to get up and running, however, it is not the preferred means to resolve the problem as you are forcing the schema of the table in the ProDataSet to be logically incorrect.
2) Modify the .NET code to specify some kind of default value for the field or fields that make up the primary key and then use either the "skip-list" parameter of the SAVE-ROW-CHANGES method or the "except-list" parameter of the BUFFER-COPY method to bypass the assignment of the default value back to the database. Doing this will allow your normal method of assigning the primary key values to execute (i.e. normally via a database trigger).