how to check if string from textbox exists in db

114

how to check if string from textbox exists in db -

// Check for duplicates
bool isDuplicate = ExistingList.Any(r => r.Name == textBox.Name);

 if (isDuplicate)
            {
                MessageBox.Show("Name already Exists");
                return;
            }

Comments

Submit
0 Comments