PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ?
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Re: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ?
![]() |
Re: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
> Either change that settting in the database (not recommended) or make an
> edit that is allowed by the database. The problem is I don't know how to edit it ! |
|
|
|
#2 |
|
Guest
Posts: n/a
|
This isn't really a .NET issue, it's an access issue coupled with your
database design. I would suggest that you open Access and attempt an edit manually and see if the database will allow it. Some edits won't be allow due to the referential integrity and some will. We can't tell you which will work and which won't, as it is something that is specific to your database. Once you know how to edit your tables manually, you can write .NET code to do it programmatically. -Scott "Bauhaus" <amineptine@hotmail.com> wrote in message news:%23rNxYe3sIHA.3680@TK2MSFTNGP05.phx.gbl... >> Either change that settting in the database (not recommended) or make an >> edit that is allowed by the database. > > The problem is I don't know how to edit it ! |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"Scott M." <smar@nospam.nospam> schreef in bericht news:eQ%23Ohk6sIHA.1772@TK2MSFTNGP03.phx.gbl... > This isn't really a .NET issue, it's an access issue coupled with your > database design. I would suggest that you open Access and attempt an edit > manually and see if the database will allow it. Some edits won't be allow > due to the referential integrity and some will. We can't tell you which > will work and which won't, as it is something that is specific to your > database. In Access I added a new PizzaNr in Pizza without any problem. And I could use this new PizzaNr in the other tables as well... So it doesnt seem to be a referential integrity problem :s |
|
|
|
#4 |
|
Guest
Posts: n/a
|
In your original message, you say you get the error when you attempt to
update or delete a record. Below you say everything is fine when you add something. These are different operations. Try updating or deleting a record in Access. The message you got is clearly a referential integrity message, but adding a new item is not necessarially going to break referential integrity. -Scott "Bauhaus" <amineptine@hotmail.com> wrote in message news:u$OsjqCtIHA.1436@TK2MSFTNGP05.phx.gbl... > > "Scott M." <smar@nospam.nospam> schreef in bericht > news:eQ%23Ohk6sIHA.1772@TK2MSFTNGP03.phx.gbl... >> This isn't really a .NET issue, it's an access issue coupled with your >> database design. I would suggest that you open Access and attempt an >> edit manually and see if the database will allow it. Some edits won't be >> allow due to the referential integrity and some will. We can't tell you >> which will work and which won't, as it is something that is specific to >> your database. > > In Access I added a new PizzaNr in Pizza without any problem. And I could > use this new PizzaNr in the other tables as well... > So it doesnt seem to be a referential integrity problem :s |
|
|
|
#5 |
|
Guest
Posts: n/a
|
> Try updating or deleting a record in Access. The message you got is
> clearly a referential integrity message, but adding a new item is not > necessarially going to break referential integrity. Updated a record in Access: PizzaNr couldnt be changed since its a primairy key in several tables, but Pizzaname wasnt a problem. But I found the problem: in my update method, the sql statement also tried to update PizzaNr, so I had to ommit it. But now I got a new error: "Violation on concurrency: 0 of 1 records are changed by the UpdateCommand." :s Any suggestions what could be wrong ? |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Concurrency errors indicate that a change being attempted conflicts with the
reality of the data (i.e. two users editing simultaneously: one simply updates a field, while the other person deltes the record and the delte is committed before the update is). -Scott "Bauhaus" <amineptine@hotmail.com> wrote in message news:%23YwfrzGtIHA.672@TK2MSFTNGP02.phx.gbl... >> Try updating or deleting a record in Access. The message you got is >> clearly a referential integrity message, but adding a new item is not >> necessarially going to break referential integrity. > > Updated a record in Access: PizzaNr couldnt be changed since its a > primairy key in several tables, but Pizzaname wasnt a problem. > But I found the problem: in my update method, the sql statement also tried > to update PizzaNr, so I had to ommit it. > > But now I got a new error: "Violation on concurrency: 0 of 1 records are > changed by the UpdateCommand." :s > Any suggestions what could be wrong ? |
|
|
|
#7 |
|
Guest
Posts: n/a
|
"Scott M." <smar@nospam.nospam> schreef in bericht news:uBGk1hItIHA.5268@TK2MSFTNGP06.phx.gbl... > Concurrency errors indicate that a change being attempted conflicts with > the reality of the data (i.e. two users editing simultaneously: one simply > updates a field, while the other person deltes the record and the delte is > committed before the update is). Thanks for your replies. I finally figured it out: With the Access database, the field PizzaNr is not an autonumber. When I tried the same database, but in sqlexpress, where I did give PizzaNr an autonumber, I also got an error, but a different one: "Cant convert DBNull to Integer". So it had something to do with PizzaNr, since that was the only field of type integer. Then it suddenly hit me when I looked again at my gridview: in the gridview, PizzaNr starts from 0... So what happens is this: when the field is an autonumber, the gridview/objectdatasource knows the field starts from 1. When the field isnt an autonumber however, the field should start from 0 ...but in Access I gave my first non-autonumber PizzaNr the value 1. Result: the code looks for a PizzaNr with value 0 but doesnt find it so it throws an exception. The reason I got the "Concurrency violation" was also because of this, 'cos the code I wrote to detect multi-user conflicts also looks for a PizzaNr with value 0... So when I ommitted the code to detect multi-user conflicts AND changed PizzaNr in my Access database to an autonumber, it worked fine. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

