Can't really think of a relevant title :-(
I have made a program in C# that registers the sales of a product. Inside my database theres two tables. One called 'Product' and another table called 'Customer'. 'Product' contains the CustomerId (so I can join the two tables), and the customer table contains the data that is relevant to the customer.
Theres a point where the user of my program has to enter the product details and the customer details. But how do I know if a customer already exists in my database' customer table? Would I have to read out all the records that are in the customer table already and compare them to the new customer details? It seems kind of devious to me.
(Need to know whether the data has already been filled in to prevent duplicates)