I'm Calling a stored procedure for password change. But it is giving me Error.
What I have tried:
And On Button Click My Function is:-
protected void BtnSave_Click(object sender, EventArgs e)
{
using (SampleDataContext dbContext = new SampleDataContext())
{
System.Nullable<char> outpt = null;
System.Nullable<long> id = Convert.ToInt64(Session["USERID"]);
dbContext.passwrdchange(id, old.Text.ToString().Trim(), newpass.Text.ToString().Trim(),ref outpt);
if(outpt.ToString()=="T")
{
ClientScript.RegisterStartupScript(this.GetType(), "SuccessMsg", "<script>alert('Password Changed Successfully')</script>");
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "ErrorMsg", "<script>alert('Old Password Does Not Match with Records.')</script>");
}
}
}
My stored procedure is:-
ALTER proc [dbo].[passwrdchange]
@ID bigint,
@oldpass varchar(MAX),
@newpass varchar(MAX),
@Out char output
As
Begin
Set @Out='F'
if(Select Password from User_Information where ID=@ID)=@oldpass
Begin
Update User_Information Set Password=@newpass where ID=@ID
Set @Out='T'
End
End
And My Linq .cs file function for Calling stored procedure is:-
private void UpdateUser_Information(User_Information obj)
{
this.passwrdchange(((System.Nullable<long>)(obj.ID)), default(string), default(string),ref default(System.Nullable<char>));
}
But this is giving me an error
A ref or out argument must be an assignable variable
Please HELP!!