i m using a gridview which is binded. i want to delete rows from multiple tables . i m able to delete from one table using delete command but not for multiple tables.
can anyone help me.
Delet record from more than one table
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 10, 2012, 1:10 AM EDT
(id int primary key,
name varchar(10)
)
create table EMpROle
(id int primary key,
Role varchar(10),
foreign key (id) references emp(id) on delete cascade )
insert into emp values (1,'A')
insert into emp values (2,'AA')
insert into emp values (3,'AAA')
insert into EMpROle values(1,'Manager')
insert into EMpROle values(2,'Accountant')
insert into EMpROle values(3,'Director')
--you can see 3 rows
select * from emprole
--am deleting only from table emp
delete from emp where id=3
--Now only 2 rows
select * from emprole
Muhammad younas164 reputationPosted Sep 10, 2012, 3:17 AM EDT
Santhosh Kumar JayaramanRank #563 · 4.3K reputationPosted Sep 10, 2012, 3:18 AM EDT