How to use store procedure to insert data in aspx page textboxes.

  • i am trying to insert some data taking from Users table in my aspx.cs page textboxes.i have written store procedure which is running successfully but not inserting data in my textboxes. please help me whether my code is right or not:

    ALTER PROCEDURE [dbo].[GetUserDetails]

    @username VARCHAR(20),

    @empname VARCHAR(20),

    @email VARCHAR(30),

    @designation VARCHAR(20),

    @reportto VARCHAR(20),

    @r int output,

    @Result VARCHAR(50) output

    AS

    BEGIN

    SELECT @r = COUNT(*) FROM Users WHERE username = @username

    SELECT @Result = username FROM Users WHERE username = @username

    END

    Here @username is coming from aspx page through querystring and according to this data should be filled in respective textboxes.should i have to pass these parameters to insert data in textboxes or not?while debugging my code i am getting the value of @username in cmd parameter but rest of parameters are coming as blank.

    please help me,if u say i can send my aspx code also to make it clear.

  • SQL is unaware of the calling application, so it cannot manipulate the calling application. SQL just returns the data. It is up to the calling application to use the resultset returned by SQL to update the values of the text boxes.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply