Articles in this section
Category / Section

How to pass the login user as parameter to Stored Procedure

Published:
Updated:

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.

  1. Create a dataset using the stored procedure, which having a UserID as parameter from Dataset dialog box.

  2. Select the dataset from Data panel and click the highlighted icon to open context menu with list of options. Select Parameters... option in the menu to open Parameters dialog box as shown in the following image. 
    select-parameters.cb0f43d.1c50620d2047a2ae72e74c5715c92ffc.png

  3. Now, click the highlighted square icon of UserId parameter to open context menu with two options and select Expression... to open Expression dialog box as shown in the following image. 
    expression.0a793ba.f2fe188e9ad997a0792ece34761f67b5.png

  4. Then, select User option under Built-in-Fields from the highlighted Options combo box as shown in the following image. 
    user-id.49ab861.622398e8325d04ec6051b8954e19763d.png

  5. Select UserID and double click it to set UserID value as shown in the following image. 
    set-user-id.1699d9e.77b3f7921888c8d56790f13152c2875c.png

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied