125 pts.
 How to pass a store procedure and a variable to a datagrid
I am a newbie when it comes to passing parameters to a control. I am programing in VS 2008 using VB as the language. The grid is in an ASP.Net (3.5) page 

I have set up a store proceduer in SQL Server 2005 as follows:

CREATE PROCEDURE

 

usp_selEmpSSN--Transfer all records from tbl_CL with the EmpPin

@CL_EmpPIN

CHAR AS

BEGIN



 

SELECT CL_DOE, CL_WC, CL_EmPIN, CL_Active  



FROM dbo.tbl_CL  



WHERE CL_Active=0 AND CL_EmpPIN=@CL_EmPIN

I know how to tell the GridView to use the store procedure but where do I pass the value for @CL_EmpPin?

Any help will be greatly appreciated!





Software/Hardware used:
Visual Studio 2008 language VB and ASP.NET(3.5)
ASKED: January 14, 2010  4:25 PM
UPDATED: January 14, 2010  5:26 PM

Answer Wiki:
From the 'GridView Tasks' menu, select the 'Configure Data Source' option, and click 'next' until you find the window where you define if you are going to use an SQL statement or a stored procedure. If you select a stored procedure, and it has parameters, when you click 'next' you should see a page where the parameters for the stored procedure are defined. You should only need to select the desired parameter, and select the appropriate option from the "Parameter Source" list box.
Last Wiki Answer Submitted:  January 14, 2010  5:26 pm  by  carlosdl   63,580 pts.
All Answer Wiki Contributors:  carlosdl   63,580 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _