I have an application which i need to delete a row from the table Client
public void Delete_Client(int _id_client)
{
Data.Connect();
using (Data.connexion)
{
string s = "Delete From CLIENT where id_client = " + _id_client;
SqlCommand command = new SqlCommand(s, Data.connexion);
try
{
command.ExecuteNonQuery();
}
catch { }
}
}
the table Client
contains a foreign references to another table. So an exception appears indicates that the deletion must be cascade.
So how can i change my code to do this ( i'am using sql server as a dbms) ?