This article is a mirror article of machine translation, please click here to jump to the original article.

View: 14224|Reply: 0

[ASP.NET] LINQ gets stored procedure return value problem my stored procedure

[Copy link]
Posted on 5/8/2015 4:27:29 PM | | |
LINQ gets stored procedure return value issue
My stored procedure
IF OBJECT_ID('UpdatePassword') IS NOT NULL
DROP PROCEDURE UpdatePassword
GO
CREATE PROCEDURE UpdatePassword
@UserID VARCHAR(20),
@UserPassWord_Old VARCHAR(10),
@UserPassWord_New VARCHAR(10)
AS
BEGIN TRY
UPDATE RBC_Users SET UserPassWord=@UserPassWord_New
WHERE UserID=@UserID AND UserPassWord=@UserPassWord_Old
RETURN 1
END TRY
BEGIN CATCH
RETURN 0
END CATCH


I get it this way
DB_RBCDataContext pro = new DB_RBCDataContext();

  int i = pro. UpdatePassword(Convert.ToInt32(Session["UserID"]), TextBox1.Text, TextBox3.Text);
  Label1.Text = i.ToString();

The result obtained in this way is always 1, I think my stored procedure is wrong... Please help me take a look··
How to write the storage procedure for addition, deletion, and modification?





Previous:Based on. .LINQ to SQL three-layer architecture development
Next:Explain the return of the Linq federated query table result set
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com