Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error saving VFP data
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00901822
Message ID:
00903139
Vues:
13
Kevin,

#1 The error in saving data is not related to VFP, the same happens if I make my table a SQL Server table. The error occurs in the line:
this.SesBizObj.SaveDataSet(dsSessions);

I found out what happens but am not sure how to deal with it. The field I edit is 40 characters wide. So 'Hiver 2005' is really 'Hiver 2005' (10 char) plus 30 white spaces. When I edit the field in the mmDataGrid, I insert a 7 to get 'Hiver 20057' (11 char) and the field is now 41 char wide. Since the structure of my table is C(40), the update fails... Of course coming from VFP this seems strange, I guess storing a C(41) into a C(40) is an error just like storing a C(10) into a N(10,0) would be...

I guess this type of thing gets obvious after you've worked for a while with .net... but how do I deal with this? Since MM.net does the databinding back to the cursor for me I don't have an opportunity to trim the input...

#2 Concerning the failed trigger error, I am not sure I understand what you mean. The failed trigger is a relational integrity trigger.

Thanks,

Thierry

>Thierry,
>
>>#1 In a row I have a field with the value "Hiver 2005", I can edit this and update it to "Hiver 2007" no problem. If I edit it to a new value with more characters such as "Hiver 20057" then it fails:
>>
>>-----------------------------------------------------------------------------
>>Cannot set column 'ses_cname' to 'Hiver 20057 '. The value violates the MaxLength limit of this column.
>>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: Cannot set column 'ses_cname' to 'Hiver 20057 '. The value violates the MaxLength limit of this column.
>>
>>Source Error:
>>
>>
>>Line 87: DataSet dsSessions = (DataSet)Session["dsSessions"];
>>Line 88: // Save the DataSet (the DataGrid automatically binds back)
>>Line 89: this.SesBizObj.SaveDataSet(dsSessions);
>>Line 90: // Reset the edited item and rebind the DataGrid
>>Line 91: this.grdSessions.EditItemIndex = -1;
>
>Hmmm...if the stack trace is correct, then the error is occurring when you pull the DataSet out of the session variable and store it into dsSessions. Can you set a breakpoint to verify this is correct?
>
>>#2 How should we manage failed triggers: I try to delete a record, the trigger fails (normal) but it throws an exception. Should I use a try/catch block? Should not this be already taken care of by the business object?
>
>In this case, your business object can check that all ranges are set properly (included maximum length).
>
>>#3 Is there an error management feature as in the VFP framework where the errors are logged etc...
>
>There is...errors are logged by the MM .NET Application Log class
>
>>#4 I could not find any documentation on the methods of the business object, only on the properties. Is there some more doc with the full version?
>
>Yes...in the latest version of MM .NET all methods of all classes are in the documentation.
>
>Regards,
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform