using (SqlConnection conn = new SqlConnection(connstring))
{
using (TransactionScope ts = new TransactionScope())
{
conn.Open();
using (SqlCommand cmd = new SqlCommand())
{
cmd.Connection = conn;
cmd.CommandType = CommandType.Text;
try
{
cmd.CommandText = "delete aa [GIS_info] where [ISSI] in (select ISSI from ISSI_info where EntityID ='" + id + "') or pcinfo_ID in ( select id from pc_info where EntityID ='" + id + "')";
cmd.ExecuteNonQuery();
cmd.CommandText = "delete Entity_info where id = " + id;
cmd.ExecuteNonQuery();
ts.Complete();
}
catch (SqlException ex)
{
}
}
}
conn.Close();