C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




stored procedure


Posted Date: 05 Sep 2008      Total Responses: 2

Posted By: mahesh       Member Level: Silver     Points: 1


how to create and insert a value to mysql using stored procedure using asp.net with vb



Responses

Author: venu kumar    05 Sep 2008Member Level: SilverRating:     Points: 1
http://aspnet101.com/aspnet101/tutorials.aspx?id=39


Author: ANIL PANDEY    05 Sep 2008Member Level: DiamondRating:     Points: 6
hi,

u can refer the Stored Procedures for the Sql thats is like..
Create PROCEDURE [dbo].[SaveUpdateUser]
(@ID int,@UName VarChar(100),@Pwd VarChar(50),@UType int,@UStatus int, @Mode int,@Result int output)

AS
BEGIN

if(@Mode=1) --Save

begin
INSERT INTO tbUsers
(UserName,Pwd,Ac_Status,UserStatus,USerType)
values
(@UName,@Pwd,'E',@UStatus,@UType)
end

else if (@Mode=2) --Edit
begin
UPDATE tbUsers SET
UserName=@UName,Pwd=@PWD,USerType=@UType,UserStatus=@UStatus WHERE Sno=@ID
end

if (@@error<>0)
begin
set @Result =-1 --Error Occured
return @Result
end
else
--checking if Mode=1(Save) then return Identity else(Edit) return 1(Which represent successfull execution as compare to negative value)
if(@Mode=1)
begin
set @Result =@@IDENTITY ----Successfuly Executed
return @Result
end
else
begin
set @Result =1 ----Successfuly Executed
return @Result
end
END



Thanks
Anil



Post Reply
You must Sign In to post a response.
Next : how to call html control in codebehind
Previous : hi regarding Autocomplete
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

internet fax

Contact Us    Privacy Policy    Terms Of Use