Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > DBConcurrency Exception

Reply
Thread Tools

DBConcurrency Exception

 
 
James
Guest
Posts: n/a
 
      02-22-2004
I am populating a datagrid with a dataview object stored in session state
To update the database I am using a commandbuilder object to generate the relevant statements

I can update and delete rows without having to re-fill the dataset (dataview)
However, if I add a new row and then delete it after postback, using the datagrid, I get a DBConcurrency exception (there are no other users making changes to the database)

If I insert the new row and then re-fill the dataset (dataview), it works perfectly

Is this how I am supposed to insert rows? Can't I get around having to re-populate the whole dataset

Here's a snippet of my code that does an insert
Dim dv As DataView = CType(Session("DataView"), DataView

' insert new row into datavie
Dim dr As DataRow = dv.Table.NewRo
dr.Item("Artist") = txtArtist.Tex
dr.Item("Title") = txtTitle.Tex
dv.Table.Rows.Add(dr

' make changes to database (using command builder
UpdateData(dv

' re-fill the dataset (dataview
LoadData(

' rebind the datagri
FillGrid()
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Exception of type 'System.Web.HttpUnhandledException' wasthrown.Exception has been thrown by the target of an invocation.System.WebSystem.Exception jobs ASP .Net 1 11-16-2007 05:57 PM
while executing my client program i get the exception javax.naming.LinkException: [Root exception is javax.naming.LinkException: [Root exception is javax.naming.NameNotFoundException: remaining if plz anybody know how to solve this problem then mahesh Java 0 03-08-2007 12:26 PM
Throw Exception Vs Throw New Exception Kerri ASP .Net 2 10-27-2003 02:13 PM
Re: bizaar exception that isn't really an exception jeff ASP .Net 3 06-26-2003 01:02 PM
Re: bizaar exception that isn't really an exception jeff ASP .Net 0 06-24-2003 12:46 PM



Advertisments