.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

control the access of data based on user id

Posted By:      Posted Date: September 20, 2010    Points: 0   Category :Sql Server
Hi, We have a cube (Insurance related project), users are grouped under a windows user group and they have their individual user id's . Now the question is how to restrict the users to view the data only related to them based on the user id(which is included in windows user-group)...?   if any mdx query is needed tell me that also

View Complete Post

More Related Resource Links

Persist data in a dynamically populated ListBox in a user control


Hi All,

I am trying to persist data in a dynamically populated ListBox in a user control. Here are the details

I have a user control which contains a a listBox and button. On Page_Load of user control I am populating the ListBox control with some values. On Click of button, I am trying to fetch the values which I have selected in ListBox. Though this seems very simple and straight forward I am unable to fetch values.

My Page_Load Function

void Page_Load(object sender, EventArgs e)










My Click Function

Protected Void Button1_Click(object sender, EventArgs e)


       string strValue = listBox.SelectedValue



I have placed brake point at Page_Load and on click function, I am seeing that the moment the breakpoin

Insert data based on gridview user value on row.. how to



I have three column comes from database table(Table1) and one column is for entering data for the user let us consider it look like this 

ItemNo ItemName Qty  uservalue

001       A               50       20

002       A               20       5

003       B               50  

004       C               60      10

005       D               40 

006       E               90      15 


If its 300 row from database to gridview it will show 50 record with page navigation..

What i need is i need to insert data in to database table which gridview row has user value..

The output of the another table(Table2) will look like this after insert

ItemNo ItemName   uservalue

001       A                    20

002       A                      5  

Access and Bind data wihtout using Datasource Control


i want to bind my gridview with a dataset with concept of caching (to minimize the database server trips). plz give me a best example to get and bind data to gridview (command line) . grid paging is also enabled so example code should be capable to rebind data at Gridview page change.  

Best practice? Accessing subset of data based on user


I have a DB and associated Asp.net 3.5 web app. The database holds information on our clients. We're adding client access functionality and I need to know how best to restrict user access to data only pertaining to their client.

The clients are stored in a hierarchy and each user can be associated with multiple clients. The user should only be able to access the data for their associated clients and any sub clients thereof.

My initial thought is to add a collection of clients to their profile, then use that to filter all queries; however, my gut instinct tells me that using the profile for such a security function is inadvisable.

Could anyone provide any insight on a best practice for this? I'm sure it must be a pretty common need.


How to Access Parent Page (.aspx) control (IDs) from its child User Control (.ascx)

I have a parent .aspx page that has a asp:panel control in it, and this parent .aspx is also referencing a user control that I registered in that .aspx. Lets just call it usercontrolA.ascx for this post.The user control has a radiobuttonlist itself.Based on a selection from the radiotbuttonlist in the user control, I want to be able to hide the asp:panel in my .aspx (parent) but unfortunately I cant' get it to work:parentPanel.visible = true;  <<< I trried this in usercontrolA.ascx.csBut the user control doesn't know about the panel in the parent .aspxSo do I need to expose that somehow from the parent so that I can access it from the code behind of the child .ascx?  How?

Need advice to control Privileges based on User

I'm a WinForm beginner. My main form is frmMain.cs Once user logged, frmMain.cs will display a menu based on User. This menu represent in button. Let's say, if User=System Admin then 3 button appear. if User=Master Agent Administrators then 5 button appear and so on How to control that? Really need advice If there's another way, please let me know

Control User Access to Document Workspace

I have set up a document workspace section with several folders and files.  I have set up a group that has full control and set up a group with contribute.  Now I would like to set up several groups that will only have access to specific portions within the site for contribute.  I see where I can set up group overall, but have not seen where to narrow down to spefici folders/files for group to view.  Do I get to the specific folder or document and then set up access or do it from Home?   Any help is appreciated! Peter

A SOA based Customizable Data Access Layer.Please comment

Hi, Actually I have an idea  to built a reusable package software .. The detail mentioned below.. ------------------------------------------------------------------------------------------ A SOA based Customizable Data Access Layer. Data access layer (DAL) is an essential part of almost every project. A data access layer can be build with all required methods(Like methods for fetching, inserting, updating data and also other methods can be built with required number of input parameters, which execute stored procedures.) in any language. Interfacing with the DAL would be a webservice. A webservice can be build with webmethods. The web service contains all web methods, which call all the methods in DAL, passing the appropriate parameters. Addition to those methods, webservice contains a method which takes database details as input parameters and passes the parameters to the method in DAL, which makes connection with database. Thus, the DAL layer and webservice, as a whole are acting as a complete package If the DAL and webservice can be built one time, it can be reused in any project with out modifying it.As the webservice is platform independent and language independent, any project can access the project/software for data operation. Using this product time can be saved so, deadline can be met easily. If this product is developed one time and can be reused by sever

Is there a way in VB.Net to embed a custom user control to a web page based on Word or Excel

Hi Everyone.  I'm looking to create a web page that would be used on a local intranet that would use a custom control based on Word and Excel.  I've used code previously to embed it in a Windows application but wasn't sure if anyone knew of any examples out there on how to embed a custom control into a ASP.Net page.

User Access Control

Hai, I am using VS2005 and SQL Server 2000 I have few small exe like duty_roster, Leave_mgt, Overtime etc. and Have a main exe named HRIS. Now I am calling these exe when run HRIS. there is a list of exe and when anyone click on the specific name then that exe open and he can work. Now I want to control on access. How can I create the dynamic access so that if I want anyone to give specific modules, menu, submenu, popmenu access then give it and later if i want i can off. I have little idea that there will be a user group with specific access. Now I create the usergroup but how can I set the access. Please help me how can I do this. It would better if u can give me link of same examples or code. please help me.please please

Access user control from another user control which is on the first user control


I have Control A and on Control A is control B.

From Control B i need to access and set the value of a label on Control A but I keep getting "Object not set to an instance of an object"

I have accessed controls before from other controls but this is the first time I have had to do it when the second control is actually ON the first control?

Login failed for user: Reason:Token-based server access validation failed with an infrastructure err



I have installed a named instance of SQL Server 2008 R2 Enterprise 64 bit on Windows Server 2008 R2 Enterprise 64 bit. The os is running as a VM ware virtual machine.

I have created an AD security group for database engine sys admins on that machine. I added my user to that group.So for example;

domainname\machinename_SQL_DBE_SysADmins is a user with SysAdmin server role permissions. User domainname\MichaelEFF is a member of this group.

When I log onto the machine as this user and run the management studio with run as administrator I cannot log into the database engine. The log shows the error:

Login failed for user: Reason:Token-based server access validation failed with an infrastructure error

I've read many posts where the MVP says that the UAC is not passing the group membership. Is this the case? If so then how will role based access ever be possible with windows authentication? How can this be resolved?




User Control Web Part - The type initializer for 'IBM.Data.DB2.DB2Connection' threw an exception.



I need help, in our SharePoint 2007 project we have created Web Part using VS 2005 & .Net 2.0, User Control. In the user control for one of the drop down list box databinding method we are using data from IBM DB2. It works fine on our local machine, but after Web Part deployment if i open the page then the Drop Down List is empty. I checked the log in the event viewer. I found the following error message in the vent viewer -

The type initializer for 'IBM.Data.DB2.DB2Connection' threw an exception.


Detail Error Message -

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/2076212728/Root

Process ID: 26880

Exception: System.TypeInitializationException

Message: The type initializer for 'IBM.Data.DB2.DB2Connection' threw an exception.

StackTrace: at IBM.Data.DB2.DB2Connection.Finalize()

InnerException: System.InvalidOperationException

Message: SQL1159 Initialization error with DB2 .NET Data Provider, reason code 7, tokens 9.1.1.DEF.2, SOFTWARE\IBM\DB2\InstalledCopies

StackTrace: at IBM.Data.DB2.y.f.a()

at IBM.Data.DB2.DB2ConnPool.g()

at IBM.Data.DB2.DB2ConnPool..ctor()

at IBM.Data.DB2.DB2Connection..cctor()

For more information, see Help and Support Center at h

Login failed for user:Token-based server access validation failed with an infrastructure error


I would appreciate help with the following issue:


I have created a local group in our SQL 2008 server and added two Windows user accounts "DOMAIN\UserName"  I  then added the local group to the database and granted read only access.


The users are trying to link tables using MS Access using and ODBC connection and getting the following error.

Users are not system administrators.


Date                      6/30/2010 1:01:54 PM

Log                         SQ

How to access label object in a user control


I thought I did something like the following inorder to find the labels in a user object but when I revisited it, it did not work.  Any ideas???




using System.Collections.Generic;







block dba access to user data


Is there a way in sql 2008 to block a dba's access to user data? I think the capability exists. however I cant seem to find any documentation on it.




asynchronous call for data population in user control


i have a user control in which i want  to populate a drop down on blur event of text box asynchronously.. i tried with page method but it gives error as method is undefined.. then i tried with writing a web service..
and called a web service method in javascript on user control.. this also gives the same error as method is undefined...project is using master pages.. so the script manager is registered in master page..
so i added service reference as

ScriptManager sm = ScriptManager.GetCurrent(this.Page);
            sm.Services.Add(new ServiceReference("../Controls/MeetingTime.asmx"));

in user control...

below is my javascript call..

function getMeetingTime()
       var uclcmbUserId = document.getElementById('<%= uclcmbActiveClients.ClientID %>'+'<%= uclcmbActiveClients.ActualComboId%>');       

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend