hello.
I use this code till I see data in my database and edit,delet and insert data in that . but I want when I insert data to database , that is not REPETITIOUS , and if that is REPETITIOUS show me a message box about it.
Code :
private void btnok_Click(object sender, EventArgs e)
{
string id = idTextBox.Text.ToString();
string name = nameTextBox.Text.ToString();
string family = familyTextBox.Text.ToString();
table1BindingSource.EndEdit();
table1TableAdapter.Update(database1DataSet.Table1);
}
private void butins_Click(object sender, EventArgs e)
{
table1BindingSource.AddNew();
}
private void butdelete_Click(object sender, EventArgs e)
{
table1BindingSource.RemoveCurrent();
table1TableAdapter.Update(database1DataSet.Table1);
}
private void butedit_Click(object sender, EventArgs e)
{
table1BindingSource.EndEdit();
table1TableAdapter.Update(database1DataSet.Table1);
}
I write this Query,but I dont know , how can I use that? I write that in "Database1DataSet.xsd" , and appeared fillby() and gatedataby() in Tableadapter.
query :
SELECT id, name, family
FROM Table1
WHERE (id = @id) AND (name = @name) AND (family = @family)