Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 446017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:25:44+00:00 2026-05-12T21:25:44+00:00

In an ASP.NET WebForms application I would like to allow the end-user to browse

  • 0

In an ASP.NET WebForms application I would like to allow the end-user to browse selected raw data in an sql-server database.

However, I would like to restrict access for the user to only view some of the data based on the username.

I’m not sure how to do this in a way that is possible for the user to understand, since SQL is not necessarily known to the user.

What options do I have here?


As a basis for this I have considered creating one sql function per table in question. That function should return the data that the user is allowed to view, e.g.,

CREATE FUNCTION ufn_RawData_Employee(@username nvarchar(256))
RETURNS TABLE
AS ( SELECT * FROM Employee 
  WHERE [@username is allowed to view the given Employee] )

In a webpage the end-user might then type an SQL-like statement like

SELECT Name, HireDate FROM ((Employee))

where (([TableName])) then could be replaced by ufn_RawData_[TableName]([UserName]) before calling the database.
(For security reasons such calls could then be performed by a sql user whose only permissions are SELECT permissions to these functions.)

However, this approach might be too difficult for the end-user. I would like to know if an easier/user-friendlier solution exists for the end-user to browse selected raw data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T21:25:44+00:00Added an answer on May 12, 2026 at 9:25 pm

    If you are only showing the user data from one table, or one view (which would probably be more useful) then yes you could store the name of that view in a table and retrieve it with a function. You could then display the data in pages, and make sure your standard select scripts have a built in search function if necessary.

    There is no need for the user to write SQL if they are only getting data from one table or view. If you need to provide multiple potential tables/ views, then let them choose from a drop down, but it doesn’t sound worthwhile to allow them to write their own SQL queries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing asp.net webforms application that I would like to add some
I'm developing an ASP.NET 3.5 WebForms application where I would like the session to
I'm currently working on an ASP.Net WebForms application that allows a user to select
I am building an ASP.NET application and would like to use a master page
I have an ASP.NET Web Forms application. I would like to create a download
Scenario I have an application using asp.net Master Pages in which I would like
I would like to upload an image from an asp.NET Web Forms (4.0) application
I have a ASP.NET Webforms application that is being used with Motorola Tablets (Android
I'm working on an ASP.NET WebForms CMS application, and having a bit of trouble
Good Morning, I'm working on an ASP.NET 3.5 webforms application and have written the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.