Solved

vb.net ado.net

Posted on 2004-08-13
9
330 Views
Last Modified: 2010-04-17
I am writing a database program using access and I would like to hardcode it. I am confussed about the disconnect and connected database.

I need to have a combobox populated with the one field of the table and when I click on the name I see in the combobox it querys the same table and pulls the rest of the data to the textboxs and queries another table in a datagrid. Now this is not going to be used for manipulation back to the database. What should I do??



Also lets say I want to make a program that many users an enter data back and fourth to a database which way is best preferred.


0
Comment
Question by:hogan9111
9 Comments
 
LVL 1

Expert Comment

by:sunny1907
ID: 11798724
 
hi, the difrence between connected and disconnected approach is pretty easy to explain. Connected approach here means, connection to database is maintained continuouslly, once connect and stay connected. This approach is handy if database access will be used frequently. On the other hand, disonnected approach is based on reconnecting to database when needed. It  heavily depends on the application area. For vb.net and ado.net examples check tutorials. good luck


 
0
 

Expert Comment

by:ashok766
ID: 11800252
I Would suggest use discounted apporach(means dataset). B'coz reduces network traffic and DB Server resources.

0
 

Author Comment

by:hogan9111
ID: 11800727
ok, but what happens if the data that the user see has been changed.

meaning if I understand correctly, 4 users are using any application and one pulls in a certain record and so does another user the one user makes a change to one field and the other user already did and saved it what happens, I am just worried about the data not being real-time.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:hogan9111
ID: 11852536
anyone??? there
0
 
LVL 2

Expert Comment

by:rattmman
ID: 11998401
You got a good point there hogan9111,

What happens is that the last user who made the change and update overwrites the previous record.  So what you could do in the code is check if the record has change before making the update.

This problem resides all the time when you have more then one user accessing the db at the same time.  The best way to handle this I think would be to lock the data when someone is entering information in it and to unlock it when they are done, that way you could pull up the latest version.

But locking gets into a problem also when your system crashes.

Hope this helps,

If you need any more info. please tell me.

RC
0
 

Author Comment

by:hogan9111
ID: 12005896
rattmman,

yes please give me more information on your method
0
 
LVL 2

Accepted Solution

by:
rattmman earned 50 total points
ID: 12007583
Hi Hogan,

What I did to avoid this situation is that I locked the record from being editted when the first user initiates edititting, that means that they've actually started changing something in the db.  But alao to avoid the record from not being seen, I then allow other users to look at the record and not change it.

I also notify the 2nd user that looks at the same record that the record is being currently editted.

This will prevent users from overridding each other and allow users to reopen the record after the record has been editted.

This is one of three ways to deal with this probelm.  But the above method is what I've been using with access.

RC
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question