O'Reilly logo

ADO.NET Programming in Visual Basic™ .NET by Bob Howell, Steve Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Insert and Delete Commands

Let’s look at the Insert and Delete statements the DataAdapter created. The Insert statement is the same whether or not we choose optimistic concurrency. Since we are adding a new row, we don’t have to worry about anyone else changing the row since it will not have existed yet. The only possible issue here is that someone else tries to add a row with a nonunique unique key. In this case, the server will abort the operation and the DataAdapter will simply throw an error.

There is a concurrency issue with the Delete statement beyond another user deleting the row before you do. What if another user made changes to the row that makes it undesirable to delete due to business rules or some other reason? For example, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required