Avatar of Karolina Sanovic
Karolina Sanovic

asked on 

how to remove error in database

when I want to save in my database I have error,how to fix that,I am working in Visual Basic.I can save only one information,when I try to save another then I get the error note
screen-22.56.45-09.04.2017-.png
screen-23.01.32-09.04.2017-.png
WP_20170411_001.jpg
Visual Basic.NETDatabases

Avatar of undefined
Last Comment
Pavel Celba
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

What I see is: Button35 uses BindingSource5  and  Button29 uses BindingSource4.
What exactly are you updating in _MyDatabase_4DataSet4  and  in _MyDatabase_4DataSet5?
If you are updating same tables then it can complain about the concurrency because one data set can contain obsolete data which were updated in the database by the previous/another UpdateAll call.

OR are you talking about the first UpdateAll success and the second UpdateAll for the same data set (same button) fails? Then you have to look into the database after the first save and confirm everything was saved correctly and then solve possible saving problems.
Avatar of Karolina Sanovic
Karolina Sanovic

ASKER

I have 6 pages and they all have the same datatable(I have template named solina1).When I use last 2 pages and insert data and click save they (sepperatly using) save in datatable,but when I put another data and try to save (same button) I have error.
First 4 pages dont work at all when try saving,they save only when I press button add new.
I put the code for all pages the same but something is wrong.
screen-datatables.png
screen-datasource.png
Avatar of Karolina Sanovic

ASKER

here are codes for first and last page
screen-first-page-code.png
screen-last-page-code.png
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

The code for all pages isn't the same because you are using different data sets. You can do it this way when these data sets are working on different data tables (on SQL backend). Once you have two data sets connected to the same data then the concurrency problem appears because data updated in one data set are not copied to other data sets and the application logic refuses saving because it evaluates it as data changed by other users.

You should redesign it. All your pages should use just ONE global dataset so they are all displaying the data from one source. Also, if you are displaying some information on more pages then you should always refresh this info when switching between pages.
Avatar of Karolina Sanovic

ASKER

I am a beekeeper and I make this form for keeping information of bees.
6 pages is for different places where we keep bees,but they have same datatables because we need to save same informations (same questions) for all places but each page sould save information for itself.
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Visual Basic.NET
Visual Basic.NET

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to Visual Basic pre-2002, it is not the same technology,

96K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo