i am giving one example which i did..... i hope it will help's you..... ]]> Untitled Page
Style="z-index: 101; left: 555px; position: absolute; top: 266px">
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Data.SqlClient; public partial class etc : System.Web.UI.Page { SqlConnection cn=new SqlConnection("User ID=sa; password=sa; Initial Catalog=sri; Data Source=TNLMSSRV"); string[] rolesArray; protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { rolesArray = Roles.GetAllRoles(); DropDownList1.DataSource = rolesArray; DropDownList1.DataBind(); } } protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { PopulateRootLevel(); } private void PopulateRootLevel() { SqlConnection objConn = new SqlConnection("Data Source=TNLMSSRV;Initial Catalog=sri;User ID=sa;Password=sa"); //SqlCommand objCommand=new SqlCommand("select a.groupid,d.featureid,a.name,b.featurename,b.featurepath from groups a,features b,aspnet_roles c,rolesfeatures d where a.groupid=b.groupid and b.featureid = d.featureid and c.roleid = d.roleid and c.roleid = (select roleid from aspnet_usersInRoles where userid=(select userid from aspnet_users where username='sri'))order by a.sorder,3", objConn); SqlCommand objCommand = new SqlCommand("select a.groupid, d.featureid, a.name, b.featurename, b.featurepat