473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Multiuser database

Hi!

I started working with .NET and I have some doubts about how to work with
multiuser database. I am using VS2008 with MySQL through ODBC for Windows
Form.

1. Is it correct to create a DataSet with all tables in the form load? And
how can I be notified if some other modifies the database, to update the
DataSet?
2. What is better: to update the database via DataSet or via SQL command?
3. How can I treat concurrency, i.e., update on the same record by 2 users?

The application works on conected and disconected way.

Thank you!
Vanessa
Jan 11 '08 #1
2 2324
Vanessa,

1. You have to handle that yourself. The DataSet is a disconnected set of
data, there is no tie to the underlying database. If someone changes a
value in the database, you are responsible for notifying your application of
the change. As for whether or not it is correct to do so in the form load,
that is up to you, and the semantics of your program.

2. Well, DataSets can't do any updates. They are merely data containers.
When you pass the DataSet to a DataAdapter, you set the SelectCommand,
InsertCommand, DeleteCommand, and UpdateCommand to command parameters that
represent statements (in this case, SQL) or stored procedures which will be
called on for every change that was made in the DataSet.

3. Given the nature of the DataSet (disconnected), you are going to want to
go with some sort of optimistic concurrency, such as a timestamp, a GUID, or
a date. Basically, when you load the record, you make sure this value is
loaded as well. Then, when you write the record back, you check to make
sure that the value is the same. If it is, then you can change the record,
if not, then you know someone else has changed it, and you should abort the
operation (and rollback the transaction, if there is one). Of course, after
you make the change, you make sure that the timestamp is updated (if it is a
guid or date, then you have to do this yourself, timestamp columns should
auto-update on change).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:9E**********************************@microsof t.com...
Hi!

I started working with .NET and I have some doubts about how to work with
multiuser database. I am using VS2008 with MySQL through ODBC for Windows
Form.

1. Is it correct to create a DataSet with all tables in the form load? And
how can I be notified if some other modifies the database, to update the
DataSet?
2. What is better: to update the database via DataSet or via SQL command?
3. How can I treat concurrency, i.e., update on the same record by 2
users?

The application works on conected and disconected way.

Thank you!
Vanessa

Jan 11 '08 #2
Thank you Nicholas!

About item 1, what technique should I use to be notified about changes in
the database?

Vanessa

"Nicholas Paldino [.NET/C# MVP]" wrote:
Vanessa,

1. You have to handle that yourself. The DataSet is a disconnected set of
data, there is no tie to the underlying database. If someone changes a
value in the database, you are responsible for notifying your application of
the change. As for whether or not it is correct to do so in the form load,
that is up to you, and the semantics of your program.

2. Well, DataSets can't do any updates. They are merely data containers.
When you pass the DataSet to a DataAdapter, you set the SelectCommand,
InsertCommand, DeleteCommand, and UpdateCommand to command parameters that
represent statements (in this case, SQL) or stored procedures which will be
called on for every change that was made in the DataSet.

3. Given the nature of the DataSet (disconnected), you are going to want to
go with some sort of optimistic concurrency, such as a timestamp, a GUID, or
a date. Basically, when you load the record, you make sure this value is
loaded as well. Then, when you write the record back, you check to make
sure that the value is the same. If it is, then you can change the record,
if not, then you know someone else has changed it, and you should abort the
operation (and rollback the transaction, if there is one). Of course, after
you make the change, you make sure that the timestamp is updated (if it is a
guid or date, then you have to do this yourself, timestamp columns should
auto-update on change).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Vanessa" <Va*****@discussions.microsoft.comwrote in message
news:9E**********************************@microsof t.com...
Hi!

I started working with .NET and I have some doubts about how to work with
multiuser database. I am using VS2008 with MySQL through ODBC for Windows
Form.

1. Is it correct to create a DataSet with all tables in the form load? And
how can I be notified if some other modifies the database, to update the
DataSet?
2. What is better: to update the database via DataSet or via SQL command?
3. How can I treat concurrency, i.e., update on the same record by 2
users?

The application works on conected and disconected way.

Thank you!
Vanessa


Jan 14 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sdastouri | last post by:
I've been looking around on the internet and have noticed there are tons of Blog programs that support multiuser login written in PHP but there are none for ASP. I am just looking for a sample...
0
by: Durai | last post by:
Hello All, How to test the "Multiuser testing" in PostgreSQL?. I used the apache bench "ab" tool for this one. The following command execute the "test.php" 50 times concurrently. $ ab -c 1...
6
by: Mike Wiseley | last post by:
We recently converted our department wide shared Access97 database to Access2K. We used to be able to open various reports in design mode and make changes to the design (or create new reports) even...
2
by: marifusman | last post by:
Acees 2.0 application when user run application it give following error. The database is opened by user "Admin" on machine "abc". you can not open this database exclusively. Please help me...
0
by: s | last post by:
I need to develop a multiuser database application to be used by four people(The number of users are not likely to increase). It is for storing records of different versions of particular papers. I...
3
by: philip | last post by:
hello i am new to asp.net and sql server 2005 programming. i am wondering how to code asp.net to prevent multiuser from modifying a share data (on sql server) at the same time. should i do some...
4
by: sumansengupta | last post by:
I created an access in access2003 , its being used in multiuser environment ..based on a particular value the database is automatically closed and only i can change the value. Even after the...
6
by: lukethegooner | last post by:
I would appreciate any comment. I want MS Access to act as a reporting tool accessing Oracle tables. The Oracle database is populated by another database application, but this application...
0
by: raamay | last post by:
I am new to VB.Net but since i have a good experience in VB6(having developed 2 to 3 desktop applications), i find no problem coping with the new environment at this stage. Well, i am planning to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.