Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Inner Join - Need Help

Author  Topic 

bulbul4u_only
Starting Member

1 Post

Posted - 2012-02-17 : 11:40:41
Hello all,

I have the below sql code working fine, but I want to add some more functions. Can you all please help me out write the code for those new functions?
This is what I want:
1) Can you please help me get the code for "Insert, Update, and Delete" code for this table now?
2) I also want to add "Password field" in the above table from the table aspnet_Membership. I have clear passwords.
3) For some users, I want them to view only admin and member's role, not the superadministrators role. So how can I filter RoleName "Superadministrators" in my other pages.

I have the below code which is working fine.
SelectCommand="SELECT     aspnet_Users.UserName, aspnet_Roles.RoleName
FROM aspnet_Users INNER JOIN
aspnet_UsersInRoles ON aspnet_Users.UserId = aspnet_UsersInRoles.UserId AND aspnet_Users.UserId = aspnet_UsersInRoles.UserId INNER JOIN
aspnet_Roles ON aspnet_UsersInRoles.RoleId = aspnet_Roles.RoleId AND aspnet_UsersInRoles.RoleId = aspnet_Roles.RoleId
where aspnet_Users.ApplicationId=aspnet_Roles.ApplicationId">


dude

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-02-18 : 08:21:05
Insert/Update/Delete's are more involved than selects for your example. For example, if you want to insert a new username, you will need to also figure out what the new corresponding UserId should be. Also, while you can select from multiple tables, you cannot update multiple tables in a single statement.

Look at the structure of your tables - what columns it has etc. and then you will need to devise a method to decide what values you want to insert for each of those columns and then write a query to generate and insert those values.
Go to Top of Page
   

- Advertisement -