Private Sub Page_Load() Session("dsStates") = Me.oStates.GetAllStates() End SubAs soon as the code is changed to take into account a postback situation as below:
If Not IsPostBack Then Session("dsStates") = Me.oStates.GetAllStates() Else Dim dsStates As DataSet = CType(Session("dsStates"), DataSet) Me.oStates.SetCurrentDataSet(dsStates) End IfThe check rules code
Public Overrides Function CheckRulesHook() As Boolean Me.ValidateStateName(Me.DataRow("cName")) Me.ValidateStateAbbreviation(Me.DataRow("cAbbreviation")) Return Me.ErrorProviderBrokenRuleCount = 0 End Functionthrows the following exception
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 27: Line 28: Public Overrides Function CheckRulesHook(ByVal ds As DataSet, ByVal tableName As String) As Boolean Line 29: Me.ValidateStateName(Me.DataRow("cName")) Line 30: Me.ValidateStateAbbreviation(Me.DataRow("cAbbreviation")) Line 31:Anyone have a clue as to how the Rules Object is losing a reference to Me.DataRow() during the process of a SetCurrentDataSet() operation?