Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
i have two forms:
**one is for searching the movie
**second one is for adding movie

**what i want is if a person adds a movie say Fast5 and that movie already exists in the database i want a error massagebox show telling that the movie already exist rather then the program crash.

**same thing for the search for am movie if it does not exist in the database an massagebox telling that theres not data..!
Posted
Updated 18-Nov-11 10:44am
v2
Comments
Sergey Alexandrovich Kryukov 17-Nov-11 18:25pm    
Not a question.
--SA
Nish Nishant 17-Nov-11 19:01pm    
I agree. Based on the curent version of the question, whether data is not found or whether data exists, he wants to show an error message box. So he might as well skip the DB query and just show a messagebox.

1 solution

So where is the problem ? go ahead.
check if your Query returns you data or not ?

C#
if Yes show MessageBox.Show("Data already exist") 
if No show MessageBox.Show("No data found") 
 
Share this answer
 
Comments
avin chand 18-Nov-11 16:44pm    
question updated.!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900