muralirajan
August 11th, 1999, 07:07 AM
I will be grateful to you if you please send me the answers.
I have a Employee table which has EmpID, Name & salary. I have a stored procedure which passes EmpID and returns the EmpName.
The syntax for creating the stored procedure is like this,
Create Procedure pr_IDInNameOut (@TempID varchar(2), @TempName varchar(15) OUTPUT)
as
select @TempName = EmpName from EmpMaster
where EmpIDl = @TempID
RETURN
Now, to execute the stored procedure with passing EmpId & to get EmpName the code is like this,
declare @ResName varchar(15)
execute pr_IDInNameOut 01, @ResName OUTPUT
select @ResName "Employee Name"
The above code works well in SQL server.
The problem is, I want to enter the EmpId in a text box of my VB form and the resulting EmpName to be displayed in a label of my VB form. WHAT IS THE REQUIRED CODE?
Secondly and most importantly, I want to display the list of the Employees in a db grid control, who are getting salary greater than the value entered in the text box.
Is it possible?. If possible what is the code for the same?
muralirajan
I have a Employee table which has EmpID, Name & salary. I have a stored procedure which passes EmpID and returns the EmpName.
The syntax for creating the stored procedure is like this,
Create Procedure pr_IDInNameOut (@TempID varchar(2), @TempName varchar(15) OUTPUT)
as
select @TempName = EmpName from EmpMaster
where EmpIDl = @TempID
RETURN
Now, to execute the stored procedure with passing EmpId & to get EmpName the code is like this,
declare @ResName varchar(15)
execute pr_IDInNameOut 01, @ResName OUTPUT
select @ResName "Employee Name"
The above code works well in SQL server.
The problem is, I want to enter the EmpId in a text box of my VB form and the resulting EmpName to be displayed in a label of my VB form. WHAT IS THE REQUIRED CODE?
Secondly and most importantly, I want to display the list of the Employees in a db grid control, who are getting salary greater than the value entered in the text box.
Is it possible?. If possible what is the code for the same?
muralirajan