473,396 Members | 2,109 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.

how to stop insert duplicate date and time in the database.

my project appointment of doctors .
in this app client get appointment to the doctor.
how to stop insert duplicate date or time in appointment?
Sep 16 '14 #1
1 1134
Frinavale
9,735 Expert Mod 8TB
Add a unique constraint to the data store for your appointments which will prevent the item from getting saved to the data store at all.

You will need to catch exceptions that indicate duplication around the logic that attempts to save the data to the data store.

You could take it one step further and add validation logic that checks the data store for the time before you even try to add it to the data store.
Sep 16 '14 #2

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

Similar topics

2
by: toedipper | last post by:
Hello, I have the following section of php code which updates a mysql record from a form. For the values of livedate and livetime I need to insert the current_date() and current_time()...
1
by: Thomas Bartkus | last post by:
If we have a date/time field and are doing frequent queries WHERE {date/time field} BETWEEN TimeA AND TimeB Does it make sense, query speed wise, to create an index on the date/time field? ...
5
by: ryan.mclean | last post by:
Hi all, I have a question about inserting records into sql server. I am brand new to sql server, always using oracle previously. Before today, I had always written statement such as this: ...
4
by: SilentThunderer | last post by:
Hey folks, Let me start out by letting you know what I'm working with. I'm building an application in VB 2005 that is basically a userform that employees can use to "Clock in". The form...
1
by: raaaz | last post by:
Hi All, I am having a totaly different sort of problem which is out of my efforts now so may be any one out of you might help me out of this. I am using very simple code below to add a record...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
4
by: goldtech | last post by:
Hi, Given an MS-Access table with a date type field with a value of: 12:00:00 AM - just"12:00:00 AM", there's nothing else in the field. I want to print exactly what's in the field, ie....
4
by: =?Utf-8?B?U2FpbXZw?= | last post by:
Hello to all. Please help me. I'm inserting a date into sqlserver 2005 using C#3. my problem is while insert is successfull my date and time. It's possible to insert only a date? -- To be...
1
by: rdsandy | last post by:
Hi, I have a table Risk, a table Mitigation and a table RiskArchive. I am taking the RiskID, Criticality and MitigationPlan fields from Risk, and MitigationActionID from Mitigation and inserting...
1
by: Rekha Angappan | last post by:
I have to insert a date/time field in access database from my java code. But the date/time field format in DB is MM/DD/YYYY HH/MM/SS AM/PM.I tried the code below. DateTime date=new DateTime(); ...
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?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.