General information
Category:
The Mere Mortals .NET Framework
Title:
BrokenRuleCount returns 0 but there are broken rules
I'm trying to loop through broken rules after an attempt to save and get the row number from GetErrorProviderRule's ErrorProviderArgs. the problem I'm having is that the rules have somehow been cleared out, the count shows 0. If I check the rules via Getallbrokenrules call then string it returns has all the messages. what would cause this? Is there another way I should be getting the record information that I need?
BTW I did set the autoclear rules to false for this BO.
If Me.oExport_Detail.Rules.HasBrokenRules Then
Dim myBrokenRules As New Collection
Dim IndexBrokenRule As Int32 = 0
Dim orule as OakLeaf.MM.Main.Business.mmErrorProviderArgs
Dim strDLN As String = ""
For IndexBrokenRule = 0 To Me.oExport_Detail.Rules.BrokenRuleCount - 1
orule = Me.oExport_Detail.Rules.GetErrorProviderRule(IndexBrokenRule)
strDLN = dsDetail.Tables(0).Rows(orule.Row).Item("DLN")
strDLN = strDLN.Substring(4)
myBrokenRules.Add(New ExportBrokenRulesEventArgs(strDLN, orule.ErrorText))
Next
endif
Thanks
Brian Grant
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only