انشات جدول
table
column1 username
column2 email
column3 phone
وجعلت phone
unique ley
ثم عند ادخال البيانات الى الجدول عن طريق
textbox
String sql = "insert into users(username,email,phone) values ('" + Txtname.Text.ToString() + "','" + Txtmail.Text.ToString() + "','" + Txtphone.Text.ToString() + "')";
SqlCommand cmd = new SqlCommand(sql, con);ولكن يحث هذا الخطا
Violation of UNIQUE KEY constraint 'IX_users'. Cannot insert duplicate key in object 'dbo.users'.
The statement has been terminated.
Line 85: cmd.ExecuteNonQuery();
ارجوكم المساعدة
ماذا ينقص هذا الكود