How to pass the login user as parameter to Stored Procedure
Use the =User.UserID
expression to pass the login user as parameter for a stored procedure. Find the following steps to pass the login user value to stored procedure parameter for getting the data from database based on user.
Create a dataset using the stored procedure, which having a UserID as parameter from
Dataset
dialog box.Select the dataset from
Data
panel and click the highlighted icon to open context menu with list of options. SelectParameters...
option in the menu to openParameters
dialog box as shown in the following image.
Now, click the highlighted square icon of
UserId
parameter to open context menu with two options and selectExpression...
to openExpression
dialog box as shown in the following image.
Then, select
User
option underBuilt-in-Fields
from the highlightedOptions
combo box as shown in the following image.
Select
UserID
and double click it to setUserID
value as shown in the following image.