在下拉列表框中使用户脱离给定角色 [英] Getting Users from a Given role in Drop Down Box

查看:86
本文介绍了在下拉列表框中使用户脱离给定角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hiya,

我正在使用它提供的ASP.NET成员资格数据库,并且希望在表单上有一个下拉框,以便为用户组中的所有成员提供选择.然后,我想获取该信息并将用户ID存储到另一个表中.简而言之,我想查看他们的用户名并存储他们的用户ID.我正在使用SQL Server2008.

有人对我将如何做有任何建议吗?

Cheers

Hiya,

I am using the ASP.NET Membership Database which it provides and I want to have a drop down box on a form to give all the members within a user group, for selection. I then want to take that information and store the User ID into another table. In short, I want to see their user name and store their user id. I am using SQL Server 2008.

Does anyone have any suggestions as to how I would do this?

Cheers

推荐答案

用于此操作的表在您的数据库中(这是使用aspnet_regsql.exe进行设置的方式)或在您的数据库中服务器(不要记得该​​名称,因为我只在自己的数据库中创建了该名称).

为此,您需要编写自己的存储过程以从必要的表中提取数据.

最好的办法是找到表,找出哪些表可以容纳所需的数据,然后将其提取-所有对象名称都是不言自明的.您还应该仔细查看它创建的存储过程,以防您可以出于自己的目的重复使用它们中的任何一个.
The tables for this are either in your database (cos that''s how you set it up by using aspnet_regsql.exe) or in a database on your server (don''t recall the name as I''ve only ever created it inside my own db).

To do anything like this you''ll need to write your own stored procedure to extract the data from the requisite tables.

Best thing to do is find the tables, figure out which ones hold the data your want and then extract it - all the object names are pretty self-explanatory. You should also look through the stored procs it creates in case you can reuse any of them for your own purposes.


这篇关于在下拉列表框中使用户脱离给定角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆