I have a maintenance form. All data operations (update/insert/delete) used to work great, until I decided to handle inserts through a stored procedure.
Well, it's still kind of works, but after new row is added and Save is clicked, BO state remains dirty no matter what. So when form is closing "Would you like to save changes" dialog is displayed, even though user did click save before (many times).
Another thing I am noticing is that BO always sees new row as "New" even after Save is clicked and changes committed to the db, so if user clicks save multiple times it keeps adding the same record over and over again.
Please help. Thank you.
private void customReport_AfterSave(MicroFour.StrataFrame.Data.AfterSaveUndoEventArgs e) { foreach (DataRow row in customReport.CurrentDataTable.Rows) { if (row.RowState == DataRowState.Added) { row.AcceptChanges(); } }
}
I hope to find better way of handeling it withing the Framework.
>> you can't use the SET NOCOUNT ON command at the top of your sproc (StrataFrame uses the count to determine the number of rows affected.) <<
It would be awfully nice if this were actually in the Stataframe documentation. Since my husband is a SQL Server DBA, he writes all of my stored procedures. I just happened to find this accidentally after a day of pulling my hair out for no reason.
Since best practice in SQL Server is to SET NOCOUNT ON at the beginning of every stored procedure to improve performance and to use @@RowCount to return the row count, my husband does not understand why the framework relies on NOCOUNT being off.
Marcia
As mentioned in the previous post, I'll include a note in the pertinent topics regarding SET NOCOUNT ON for the next release. Sorry for the confusion!
>> As mentioned in the previous post, I'll include a note in the pertinent topics regarding SET NOCOUNT ON for the next release. Sorry for the confusion! <<
No worries I really am not rying to beat you up on this one. All in all, I am happy with my choice to go with Strataframe. It's a big product, so I expect to get a few bruises on the learning curve
Well, having written my own VFP framework, I understand all too well that all frameworks make assumptions and in order to use the framework effectively, one has to understand what those assumptions are That is the learning curve and it can't be avoided.