Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi please help me any one
i am currently work in vb.net
and i create stored procedure in sqlserver i.e

SQL
ALTER PROCEDURE dbo.ChangePass
	
	(
	@UserName varchar,
	@Password varchar
	)
	
AS
	UPDATE Admin_Set  SET Password=@Password WHERE UserName = @UserName
	RETURN

so i want to this query code in vb.net also i tried as fallow

C#
cmd.Parameters.Add("UserName", SqlDbType.VarChar).Value = UsernameTextBox.Text//this code not work in update query

            cmd.Parameters.Add("Password", SqlDbType.VarChar).Value = PasswordTextBox.Text

            Dim qr As Integer
            qr = cmd.ExecuteNonQuery()
            MessageBox.Show("SignUp Successful", qr.ToString())
Posted
Updated 20-Nov-11 22:53pm
v2

1 solution

are you Using this line, if not use
C#
cmd.CommandType = CommandType.StoredProcedure;

using Stored Procedure in c#
using Stored procedure in VB.Net
 
Share this answer
 
v2
Comments
ram salunke 21-Nov-11 23:24pm    
This is not perfect answer, because i have already include.
cmd.CommandType = CommandType. Stored Procedure;
so friend i have 2 parameters i.e uname and pass and i want only change password whare username= @UserNameTextBob.Text
cmd.Parameters.Add("UserName", SqlDbType.VarChar).Value = UsernameTextBox.Text//this code not work in update query
(please see query from my question)
thanks........
for eg.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900