PC Review


Reply
Thread Tools Rate Thread

DataAdapter.Update???

 
 
Darryn Ross
Guest
Posts: n/a
 
      13th Sep 2004
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


 
Reply With Quote
 
 
 
 
Val Mazur
Guest
Posts: n/a
 
      13th Sep 2004
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
>
>



 
Reply With Quote
 
Darryn Ross
Guest
Posts: n/a
 
      13th Sep 2004
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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dataadapter.Update() multiple table update strategies jarb Microsoft ADO .NET 3 2nd Nov 2006 09:57 AM
DataAdapter.Update A.M-SG Microsoft ADO .NET 1 19th Jan 2006 03:16 AM
How best to update DataAdapter to make DataGrid update immediately like table in Access would John Edens Microsoft Dot NET Framework Forms 1 5th Aug 2005 08:44 AM
DataAdapter.Update Command Failed To Update Database Chris Lee Microsoft ADO .NET 10 4th Aug 2004 07:53 PM
DataAdapter update Ruslan Shlain Microsoft VB .NET 1 5th Feb 2004 09:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:19 PM.