Change Database Roles In SQL Through VB

Apr 23, 2010

I fiqured out how to create a new user in vb for SQL, but when I try to access the database, I get a select error. I went into SQLMSO and changed the membership role to db_datareader and db_datawriter and ran my form again and I was allowed to delete and add records. Is there a way with the below to add a user and let them add and delete records.

[Code]...

View 1 Replies


ADVERTISEMENT

Using Roles In MVC 3 App

Nov 4, 2011

I have an issue to do with roles in mvc 3 vb.net app..Say I have Admin, Developer, PowerAdmin roles.. if I want to restrict view options based on roles I have been using a if statement in the view to hide the link all together such as:[code]I am also decorating controller actions with authorize in places. The Problem is this say I have several actions that should only be available to say a user who is in all three roles or even 2 of the roles in any combination.. Would I simply nest the if statements in the view to hide those view items? What about controller functions.. Is it possible to decorate controller functions with something like [code]and then have that function only accessible by someone with both roles????

View 2 Replies

(SQL) List User Roles Via SMO

Jun 21, 2010

Is there a method for checking which roles a user has in SQL using SMO? I can add a role via: user.AddToRole("Administrators") But cannot see an obvious method to progmatically list them.

View 2 Replies

Roles Only Returning 1 Role

Jun 16, 2010

I am having a problem with my roles Identification. I am try to read all the roles for a given user. No matter what I try only the first role, only 1 role for the user is being returned. My code is as follows.

[Code]...

View 3 Replies

Asp.net - Setting Up Different Roles Depending On Url In Web.config?

Jan 17, 2012

<authentication mode="Windows"/>
<authorization>
<allow users="USERS"/>

[code]....

Is there a way to write an if statement in here to detect what url I am on so I can allow a certain role for that certain URL.

Example code in my head of what I kind of want to see:

If (UCase(Url) = UCase("URL")) Then
<allow roles="ROLES"/>
ElseIF(UCase(Url) = UCase("URL")) Then

[code]....

Is this even allowed in the web.config? I have 3 websites. One for Dev, UAT and PROD. Now for each sites I have different user groups for each set up. I just want to find a way that I can just find what URL i'm at and point it at the certain user group. I'm guessing I have to make a web.config for each because you can't do conditional statements but I'm just making sure. If I have to make a web.config for each how can I go about setting that up?

View 3 Replies

ASP.NET MVC Custom User Roles / Profiles

Jan 15, 2010

I am creating a website using asp.net mvc model. When you create an mvc application asp.net automatically creates roles/profiles for user and admins (as far as i know) and corresponding tables in sql server database.I a need a new profile/role names "sponsor" that has all the benefits of users/admins (like authorization etc).

View 1 Replies

How To Show Roles Based Menu

Dec 9, 2009

How to show menu according to their roles in vb.net2.0

View 8 Replies

Vb.net - Membership Roles.GetUsersInRole Not Working For Me

May 13, 2010

[code]...


The code above throws a "Specified method is not supported." exception on the first line.
Any one knows what am doing wrong here?

View 2 Replies

Detecting Change In Database / Displaying Word 'change' On Screen In Realtime For Any Client Connected

Nov 30, 2010

Can someone please help me create a very very simplistic sample page as the chat page included is too coomplete. something as simple as detecting a change in the database and displaying the word "change" on screen in realtime for any client connected.and I tried creating a global.asax file into which I added in the line mentioned in the link above, but it does not seem to like the word "Setup" in the line [code]

View 2 Replies

MySQL Database - If I Change The Item From The Combo Box..the Textbox Not Change?

Dec 2, 2009

whats wrong with my code?if i change the item from the combo box..the textbox not change or has an error?

conn = New MySqlConnection()
conn.ConnectionString = "server=localhost; user id=root; password=12345; database=gigzta; allow zero datetime=no"
strsql = "SELECT accNo FROM accinfo WHERE (completename LIKE '%" & ComboBox2.Text & "%')"[code].....

View 14 Replies

Add User To Roles During CreateUserWizard.CreatedUser Step?

Jan 22, 2011

How to add user to roles during CreateUserWizard.CreatedUser?What's wrong in this code:

Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As EventArgs) Handles CreateUserWizard1.CreatedUser
Dim username As TextBox =

[code]....

View 1 Replies

How To Add Hide Two Roles From String Array .GetallRoles()

May 30, 2009

I want to hide two specific roles from string Array(Admin,Member). Right now it lists all the roles

in my checkbox control. This is my code.[code...]

View 2 Replies

Roles.getallroles Method Not Appearing With Intellisence?

Apr 14, 2009

Trying to retrieve all roles for a user. Thought maybe I could select by User.

When I key " roles. " the getallroles method does not appear as an option. I get "Add,AddRange,BinarySearch,Capacity,Clear,Contains,Count,IndexOf,Insert,Item,Remove,RemoveAt,Sort,ToArray".

View 2 Replies

Sql Server - Roles And Permissions In Windows Forms

Dec 7, 2011

I am wanting to update our current windows forms security to something a lot more flexible. At the moment we have a single column in thew users table which is named 'Access_Level', this field holds an int value (1 to 4) which is then use to determine users access to certain areas of the application. This worked fine when the system was small, but the system is growing rapidly now so I think it is a good time to update the user access and possibly introduce roles.

[Code]...

View 1 Replies

Winforms - Use Custom Roles For User Access?

Sep 2, 2009

I have a winforms (VB 2008) based app that I'm developing and I want to use custom roles for user access.Application Layout:I have a Main form that opens a login form when certain actions occur.The Login form intern uses an authentication class that I've created, to authenticate users and set access rights.On my Applications settings page, I have Authentication Mode set to Application-defined because I cannot use Windows Authentication in the environment where this will be deployed.

The application uses a MS SQL 2005 db and the 3 tables I'm using in the authentication process are the User_Account , User_Roles and User_Access tables. The combination of an account in the User_Account and the roles within the User_Roles table are the bases for the User_Access table. Using the User_Access table is how I assign access to the various functions within the application

Authentication Method:To authenticate a user, I'm using the "My.User.CurrentPrincipal" (Code below) method. The My.User object works great and allows the use of "My.User.Name" property throughout the app when referring to the currently authenticated user.

Access Method:In order to set the current users access levels I'm using a function within my Authentication class and passing in My.User.Name as a variable. The function uses a Dataset Table Adaptor and a Select Case statement inside a For loop to assign all the access levels for the user (Function code below).

My Problem:This method of assigning access rights to a user does work but it's not persistent throughout the application as the My.User object is.I would like to find a way to create custom roles through the My.User object using its .IsInRole property. I would like to have these roles dynamically created using my User_Roles table.This would allow the custom roles to be used throughout my application using the My.User.IsInRole ("MyRole")syntax ...similar to how I'm currently able to use My.User.Name.Unfortunately the only roles I can currently validate against are the built in Windows
type accounts (Adminisrator ...ect.).

'User Authentication example:
If Authenticate.CheckPassword(tbxUserName.Text, strPassword) Then
My.User.CurrentPrincipal = New GenericPrincipal(New GenericIdentity(tbxUserName.Text), Nothing)[code].....

View 1 Replies

C# - Storing Static Files To Be Shared Among Azure Roles

Sep 13, 2011

I'm trying to host some static files for access by an ASP.Net web role and a separate data worker role that are both running on the same deployment (they use a global static interface).

However, I'm unsure how exactly to 'host' them, I've tried using virtual folders via HttpRuntime.AppDomainAppPath, but it only occasionally works in debug mode. The files also don't seem to get packaged into the deployment packages made by VS vis CSPack (though this might be a separate issue, is it possible to fix this too?)

The static files in question are actually WordNet, which I'm using through WordNet.Net, If that makes any difference. I also need the solution to work in both the cloud deployment and the emulator (if possible).

View 2 Replies

Implement Custom User-roles In Windows Application

Apr 21, 2010

I am looking for ways to implement custom user-roles in windows application with vb.net. I got a database table called Roles with Administrator and User entries. User cannot see some of the form data. In ASP.NET MVC we can do like.

[Authorize(Roles = "Administrator")]
public function GetAccount() as Array

End Function

View 1 Replies

Use Custom SqlMembershipProvider To Store Users (and Roles) In Cache?

Feb 15, 2011

I'm developing a "small" warehouse-management WebApplication for few users(5-10 parralel) but with a complex authorization system(checking if pages,menus,TabPanels, UserControls and even single controls are visible or enabled) and permanent and frequent access. Because i've only limited experiences with the ASP.Net MembershipProvider, i'm unsure what's the best approach for following goal:

I want to hold all users, roles and frequently used masterdata in the Cache(in a Dataset). Hence every readonly access should be faster and causes less traffic than always using the database. On updates,deletes and inserts i would update the cached dataset and also the database.

Can i use or extend the SqlMembershipProvider to achieve this goal and if possible how?

View 1 Replies

Use Membership Roles Using Sql Provider In Windows Forms Application?

Nov 22, 2010

Is it possible to use membership roles using sql provider in windows forms application

View 1 Replies

Conrolling Site Access Via Windows Authentication And Roles / Groups

May 30, 2012

I am trying to restrict access to an intranet site via Windows authentication. I would like to control access via active directory user groups, but my added AD groups don't appear to be recognised by .net. I started with the following test code in my app to determine if the group could be used...

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Label1.Text = User.Identity.Name

[Code]...

The isuserinrole returns false and the group is not shown in getrolesforuser. However, getrolesforuser returns all of the built in windows groups as well as custom admin user groups created by our anti virus software (SOPHOS). This tells me that .net doesn't seem to have any issue with reading our active directory but I don't understand why my custom group is not being recognised.

View 1 Replies

Make A DetailsView Where Only Users With Specific Roles See Some Fields As Editable?

Dec 16, 2011

For example lets say I want only admins to be able to see and edit CustomerID in details view, moderators can see this value but it is not editable, and regular users cannot even see it.

View 2 Replies

Disable Menu Items Based On Allowed Security Roles Specified For An Item?

Nov 23, 2009

How to enable / disable menu items based on allowed security roles specified for an item.

View 6 Replies

Administer Website (create New Users, Assign Users To Roles) From A Windows App?

Feb 9, 2010

I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.Here is the membership provider definition from web.config:

<membership defaultProvider="MyProvider">
<providers>
<add name="MyProvider"

[code].....

View 3 Replies

See If Current User's Group Name Matches A Specified Group Name Using Active Directory Roles And SID's?

May 3, 2011

I'm trying to match up a specific group name and see if it exists for the currently logged in user using Active Directory roles. If the Group Name exists for the Current User, I want that group name to be displayed in a drop down list. Example: If current user is in BIG Group, display BIG in drop down list.Problem: All I am getting is SIDs and I'm not able to get anything to match up to the group name and nothing will show up in the drop down list.I also get the following Error:Error: Object variable or WIth block variable not set.How do I fix this?? here is the code I am using:

Private Sub GetMarketingCompanies()
' code to populate marketing company drop down list based on the current logged in users active directory group that

[code].....

View 3 Replies

Change Value In Database?

Jan 22, 2010

This code works (I skipped some code here). I put it here to show names of my database, tables and fields.[code]...

View 3 Replies

Change Database On Runtime

Jun 9, 2008

I have an application that connects to a database on sql server. I want to make it possible to use another database that has the same structure as the one im using now (for example accounts2007 and accounts2008).

There is a form for login where user have to choose the database that he wants to use.

View 1 Replies

Change DataSet When Database Changes?

Feb 19, 2010

I am using VB 2008 frountend & Access Databases for my backend.When i make changes to Database such as Change In Field Name, Change In Data Type, Change In field size Addition of new Fields, Deletion of old fields, ReOrdering fields names I use to reconfigure DataAdapter in dataset to take those changes in effect, however some changes took place where some other doesn't.get those changes in effect in right order.

View 1 Replies

Change Item Of Database?

Dec 13, 2011

I have an application with a database. I can add, remove and save items but when I want to CHANGE an item and save it, the program gives the following error: Update requires a valid UpdateCommand when passed DataRow collection with modified rows.

I am using "service-based database" from visual basic itself. No acces or something.

View 4 Replies

Change On DataSetDesigner And On Mdb Database?

Jun 3, 2010

In VisualStudio I have a tableadapter loading my *.mdb database. The problem is that when i have started, my "Phone" field was on Int.16, but now i nedd to change it to Int.64. I have already tried to change on DataSetDesigner and on mdb database, but when i press "Insert" button i got this message:

"Failed to convert parameter value from a Int64 to a Int16."

View 14 Replies

Change The Database To SQL 2008?

Jan 8, 2010

I have a large project that was originally written in VB6 using an ACCESS database. I want to rewrite it in vs2008 and change the database to SQL 2008. Someone on this site suggested that I look into NHibernate, which I am trying to do. Most of the samples are written in C#. My question is, does anyone know where I can find a sample of a project that is using NHibernate and VB.net? Or is there a better way to go?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved