Here is my Delete Method, GetSelectedRows is a method i have in my custom
class that returns the indexes of all rows that are selected in an Array
List Type.
try {
ArrayList AlDeleteList = new ArrayList() ;
AlDeleteList = dg.GetSelectedRows(dg) ;
DataTable dt = Ds.Tables["tbl"] ;
int j = 0 ;
for(int i = 0; i < AlDeleteList.Count; ++i) {
j = (int)AlDeleteList[i] ;
dt.Rows[j].Delete() ;
}
}
catch(Exception e) {
MessageBox.Show(e.Message, "DeleteTransaction", MessageBoxButtons.OK,
MessageBoxIcon.Error) ;
}
This is my Update Method....
bool result = true ;
try {
tblConnection.Open() ;
tblAdapter.Update(Ds, "tbl") ;
}
catch(Exception e) {
MessageBox.Show(e.Message, "Save", MessageBoxButtons.OK,
MessageBoxIcon.Error) ;
result = false ;
}
finally {
tblConnection.Close() ;
}
return result ;
"Val Mazur" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> What is your code?
>
> --
> Val Mazur
> Microsoft MVP
>
>
> "Darryn Ross" <(E-Mail Removed)> wrote in message
> news:%23$(E-Mail Removed)...
> > Hi,
> >
> > I am getting the following error when calling the Adapters update method
> > after i have done some deletions from my dataset through a datagrid.
> >
> > "Delete row information cannot be accessed through the row."
> >
> > Can anyone please tell me what i am doing wrong?
> >
> > Regards
> >
> > Darryn
> >
> >
>
>
|