473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how do i select everything except a UserName in sql?

lightwalker19
hi, basically what i need is to "block" a username(
Expand|Select|Wrap|Line Numbers
  1. @username = Profile.Username
meaning i want to block the current user online) in the SQL statement
Expand|Select|Wrap|Line Numbers
  1. SELECT
  2.  vw_aspnet_UsersInRoles.UserId, vw_aspnet_Users.UserId AS Expr1, vw_aspnet_UsersInRoles.RoleId 
  3. AS Expr2, vw_aspnet_Roles.RoleId, vw_aspnet_Users.UserName, 
  4. vw_aspnet_Roles.RoleName, aspnet_Profile.UserId 
  5. AS Expr3, aspnet_Profile.PropertyNames 
  6.  
  7.  
  8. FROM 
  9. vw_aspnet_Users INNER JOIN vw_aspnet_UsersInRoles 
  10. ON vw_aspnet_Users.UserId = vw_aspnet_UsersInRoles.UserId 
  11. INNER JOIN vw_aspnet_Roles ON vw_aspnet_UsersInRoles.RoleId = vw_aspnet_Roles.RoleId INNER JOIN aspnet_Profile
  12. ON vw_aspnet_Users.UserId = aspnet_Profile.UserId
  13.  
  14.  WHERE (vw_aspnet_Roles.RoleName = 'Aluno')
im using a griedview to display the statement, but all my attempts to make the row with the username invisible failed :S

this is my last attempt to make the row invisible..

Expand|Select|Wrap|Line Numbers
  1.  protected void GridView1_Load(object sender, EventArgs e)
  2.         {
  3.            GridView1.AllowPaging = false;
  4.             GridView1.DataBind();
  5.             int rowcount = GridView1.Rows.Count;
  6.             for (int i = 0; i < rowcount; i++)
  7.             {
  8.                 String user = Label14.Text;
  9.                 if (GridView1.Rows[i].Cells[0].Text == user)
  10.                 {
  11.                     GridView1.Rows[i].Visible = false;
  12.                     GridView1.DataBind();
  13.                 }
  14.             }
  15.             GridView1.AllowPaging = true;
  16.             GridView1.DataBind();
  17.  
  18.         }
help? :)
Apr 12 '12 #1
2 2143
Monomachus
127 Expert 100+
Block meaning delete? Or just disable? Give more details please.
Apr 13 '12 #2
I just want to make disappear the row on the gridview that has the current user name. like profile.username or httpcontext. i just dont know how to do it.
Apr 13 '12 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Neil | last post by:
Hello, I do hope some kind soul can help me with what I thought was not going to be difficult, but for this newbie it's a bit harder than I thought. Here's what I'm trying to do..... I can...
1
by: Ferreira | last post by:
Hi. I have a simple query that is similar to this one: SELECT distinct b.username from permissions a, users b, links c where a.user_id = b.id and c.information = 14; In this case, it...
14
by: Melanie Avids | last post by:
Hi, I'm tired of banging my head on the computer. I'm hoping someone can help? I have a very small simple page that looks perfect in Firefox, Safari, and Netscape. It's clean. The HTML and CSS both...
2
by: abracad_1999 | last post by:
I would like to create a form in which a 2nd select box appears depending on the value selected in the 1st select box. The values of the 2nd select box will come from a database. My question is...
10
by: Michele Simionato | last post by:
I have always been curious about how people implement mainloops (or, in Twisted terminology, reactors). So I sit down and I wrote the following simple implementation: import itertools class...
0
by: HomerS007 | last post by:
Hi, I'm using asp.net 2.0 and sql server 2000 for my first ever project. On one of the page in the application, I want to limit what the user can see based on his/her login. It's a page that...
5
by: duncanusher | last post by:
MYsql Script I am trying to output a concatuating file for results in a querie, if I am right the script below is actually known as a injection query and i am unable to get it to work ...
5
TheServant
by: TheServant | last post by:
Hey there again, I have made a form which allows users to train soldiers depending on whether or not they have the resources. The content concerned is set out like this: -- Header -- -- Info Bar...
8
by: J360 | last post by:
Access 2003/Windows XP I have several multi select listboxes on a form. No selection by the user is currently coded as if the user selected all: If Len(strAVP) = 0 Then strAVP = "Like...
2
by: Donna Horton | last post by:
If I create a Select statement to select a username and userid from a table then I want to select the userid from another table and sort on the userid for example I sorted on the email usernames and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.