I am new to this, so bear with me. I am writing an application in C# that uses LINQ to validate a datacontext off a textbox to see if the record exists already. If the record does exist I inserted an if statement to advise the user that the record exists, if the record does not exist I would like to allow the record to be added to the database. If I take out my else statement everything works fine as far as inserting goes, but I do not want to allow inserts in this scenario. I have tried moving the if and else statement to different parts of the code but can't quite figure this one out. Any help would be apprecaited, attached is the code. This code is set to a button press. As a matter of fact, if you see any other errors along the way please feel free to point them out.
protected void enterBTN_Click(object sender, EventArgs e)
//make new data context
SHCDataContext insNewAll = new SHCDataContext();
//LINQ to check if customer exists in database
var checkExisting = from c in insNewAll.Customers
//make list to store values
View Complete Post