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

how to validat the data if the data allready exist in the table record in c#?

how to validat the data if the data allready exist in the table record in c#?
for example i wanted to add the studend roll no. if roll no. is 134 and if we are adding rollno. 134 student then we get the warning like roll no. 134 is allready exist
Sep 24 '14 #1
1 1268
pod
298 100+
You "addData" function should return a stringMessage

Before adding any new records,
your data layer script should perform a search for existing data.

Expand|Select|Wrap|Line Numbers
  1. search for existing data 
  2. If a match is found then 
  3.    no data will be inserted
  4.    return a message saying "unable to add, data already exist"
  5. else
  6.    insert the data
  7.    return a message insertion succesful
  8. end
Hope this helps

P:oD
Sep 24 '14 #2

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

Similar topics

1
by: Babs Patel | last post by:
I'm new to database design, but I understand the basics of MySQL and php. To make a simple music database in MySQL, I've made a table of songs (song) and a table of players (player) joined by a...
0
by: sql_Michael_dotnet | last post by:
Can anyone help me figure out how to insert data into SQL Server when a table to hold the data does not yet exist. I am able to insert data into a existing table in the following fashion. But what...
1
by: VMI | last post by:
How can I dump a datatable into an Access table (which contais exactly the same structure)? Somebody suggested doing this with a dataAdapter. I don't want to run an Insert query for each record (I...
3
by: hazz | last post by:
if i have a table record called Rule 1 with 1. table name 2. table column name 3. operator (>,< =) 4. value (0 to n) 5. score how could I create code to create a rule automatically so...
3
by: PAUL | last post by:
Hello, I have 2 datasets I am trying to update. The parent table seems to update fine but when I go update the chiled table I get an error message that says I need a related record in the parent...
11
by: Kay | last post by:
Hi all, I have populated a dataset with several tables, say - Roster, Agent and few more . The dataset is used to populated a listview with some shift info.. I think I'm sucessfully created a...
1
by: vineetbindal | last post by:
I am using GridView in silver light application i am following some example blogg something scoutt's blog. i need to have access to my grid view in my cs file, when i type in "using...
1
by: jimb | last post by:
I have written code in vba: 1. reads a recordset 2. does some calculations and places results in variables 3. load data into a new table. i'm processing 4000 records and don't want to be...
4
by: franknagy | last post by:
Hi, How can check each records in a data grid and move the record pointer to the correct record. I have three text boxes red, green and blue. I have an MSAccess database with fields code, red,...
15
Claus Mygind
by: Claus Mygind | last post by:
I am using php 5.3 and MySQL 5.0 The php is installed using mysqli not pdo So I cannot use pdo syntax I have 3 prepared statements 1. one for look up 2. one for INSERT 3. one for UPDATE
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.