G
Guest
How do I get a datarow from a dataset? I have a datagrid and want to pass the selected datagrid row selected for update to another class to do validation. I get the following exception
There is no row at position 0.
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.IndexOutOfRangeException: There is no row at position 0
Source Error:
Line 158: 'Dim lViewState As System.Web.UI.StateBag = Me.ViewStat
Line 159: 'mDataRow = Me.DsNorthWind_CustOrders1.Tables(0).Rows.Item(mRowIndex
Line 160: mDataRow = Me.DsNorthWind_CustOrders1.Tables(0).Rows(mRowIndex
Line 161: 'send rowindex & datarow to ActivateRule for validatio
Line 162: mActRule.Validate(mRowIndex, mDataRow
Source File: c:\inetpub\wwwroot\ExceptionBeta\WebForm1.aspx.vb Line: 160
Stack Trace:
[IndexOutOfRangeException: There is no row at position 0.
System.Data.DataRowCollection.get_Item(Int32 index
ExceptionBeta.WebForm1.UpdateCommandEventHandler(Object sender, DataGridCommandEventArgs e) in c:\inetpub\wwwroot\ExceptionBeta\WebForm1.aspx.vb:16
System.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs e
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData
System.Web.UI.Page.ProcessRequestMain(
There is no row at position 0.
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.IndexOutOfRangeException: There is no row at position 0
Source Error:
Line 158: 'Dim lViewState As System.Web.UI.StateBag = Me.ViewStat
Line 159: 'mDataRow = Me.DsNorthWind_CustOrders1.Tables(0).Rows.Item(mRowIndex
Line 160: mDataRow = Me.DsNorthWind_CustOrders1.Tables(0).Rows(mRowIndex
Line 161: 'send rowindex & datarow to ActivateRule for validatio
Line 162: mActRule.Validate(mRowIndex, mDataRow
Source File: c:\inetpub\wwwroot\ExceptionBeta\WebForm1.aspx.vb Line: 160
Stack Trace:
[IndexOutOfRangeException: There is no row at position 0.
System.Data.DataRowCollection.get_Item(Int32 index
ExceptionBeta.WebForm1.UpdateCommandEventHandler(Object sender, DataGridCommandEventArgs e) in c:\inetpub\wwwroot\ExceptionBeta\WebForm1.aspx.vb:16
System.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs e
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData
System.Web.UI.Page.ProcessRequestMain(