
I want To Update Multiple Table. It's Taking To Much Time, Some Time Memory Problem. Is There Are Any Solution For That?

Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sudhakar ChaudharyPosted Oct 19, 2012, 11:34 AM
Shivanand ArurPosted Oct 19, 2012, 9:04 AM
And then call the Stored Procedure from the Code... Take a look at this Example....
I have 2 tables - Tbl_MemberUser and Tbl_AdminUser
Columns in Tbl_MemberUser -
MemID MemName MemPass MemAddr
1 Shiv shiv@pass Mumbai
2 Anand anand@pass Delhi
Columns in Tbl_AdminUser
AdmID AdmName AdmPass AdmAddr
1 Admin1 adm1@pass Mumbai
2 Admin2 adm2@pass Kolkata
--------------------------------------------------------------------------------------
Now I want to update these tables from the Stored Procedure...
Create Procedure Update_Members
(
@iMemID int,
@iAdmID int,
@sMemAddr varchar(50),
@sAdmAddr varchar(50),
)
AS
BEGIN
UPDATE Tbl_MemberUser SET MemAddr = @sMemAddr where MemID = @iMemID
UPDATE Tbl_AdminUser SET AdmAddr = @sAdmAddr where AdmID = @iAdmID
END
--------------------------------------------------------------------------------------
Now I'll write my code like this...
protected void btnUpdate_Click(Object sender, EventArgs e)
{
}
This may not be a proper example, since I am trying to pass the ID, but you can just relate the code and try to change yours!!! Hope this helps you out.
PLEASE MARK THE ANSWER AS ACCEPTED IF IT HELPED!!!