473,385 Members | 1,472 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,385 software developers and data experts.

my database disconnects when I preview my program

Hi :)

My database disconnects when i preview my program, I have de DataSet made all of that but it still DC's and i cant send information to the database.
I'm making a WaitLine Program so that in my working place the shop could have a system of waiting lines.
I made two projects in the VB one for the screen at the entrace of the shop and another for the shopkeeper for nexting for another customer and the two projects are using the same database.

Can anyone help me?
Apr 4 '12 #1
1 1367
Frinavale
9,735 Expert Mod 8TB
You should only keep a connection to the database open when you are using it to retrieve or save data to it.

You should open a connection to your database to fill your DataSet and then close the connection after you finish the fill (or if the fill fails).


When you are ready to save the data to the database, open a connection, issue an update using your DataAdpater in order to update your database, and then close the connection again.


If your application fails to close a connection, it could prevent other applications from connecting to the database. That is why it is best to make sure to close connections after you are finished executing your query.


If you need to ensure that data is refreshed, then periodically reconnect to the database to retrieve fresh data. Determine when the most logical time is best to do this.

Just a thought, if you really want to get fancy, consider writing a service that uses sockets so that both of your applications can connect to it. When one of the application updates the database, this service can push a message to all of the applications connect to it (via sockets) to inform them of the update. This service would have methods to save and retrieve data from the database that your applications would use. That way, whenever any application calls these methods the service will know to push a message out to anyone listening, informing them that there is new data available. You could use UDP to transmit the message even.



-Frinny
Apr 4 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Javier Villegas | last post by:
Hi I want to know when we could download Oracle Database 10g Thanks
1
by: Ruth | last post by:
Alison, You are going to find this a real coincidence! To begin with, I am Roberta Laird's husband. I think you know Roberta. We also are friends with Laura McConnell. Anyway, I am in business...
3
by: junaid | last post by:
Hi to all, Can it is possible to connect to the databse like postgre or mysql through a C programm? I know the basics of C and I have developed a small program which uses a file for the...
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
8
by: mesut | last post by:
Mybe it's a stupid question but : I'm starting to learn VB.NET. I have some basic skills. I'm from Mainframe world and I have same question to make my DATABASES (tables and relation) I would like...
1
by: TheRain | last post by:
I'm working on a .NET C++ project. The program loads and creates a tray icon, but is not visible on the screen. So what I'm looking for is a way to detect when a specific key combination is...
1
by: D'artagnan | last post by:
Dynamically allocated (malloc) memory is returned back to the OS when a program terminates normally. But what if the program crashes? Is its heap also freed? Thanks.
2
by: bienwell | last post by:
Hi all, Do you have any source code to import data from Excel file or text file into database in ASP.NET program ? Please give me your reference if you have. Thanks in advance
6
by: matt.b.williams | last post by:
I am writing a program for a handheld device. It is a simple C program and it runs in a DOS like environment. I'm compiling it in Microsoft Visual C v1.x. Anyway, as part of this application, I...
2
by: mariaz | last post by:
Hello, I am creating a project where I parse an xml page (feed from a website) in a javabean file and I insert the parsed data in a mysql database. I want this data that gets inserted into the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.