C# - Get A List Of Banned Users By Date Descending?
Feb 27, 2011
Im doing something like this to get a list of all users that have been blocked:
public IQueryable<Aspnet_User> GetBannedUsers()
{
return db.Aspnet_Memberships.Where(x => x.IsApproved == false).Select(x => x.Aspnet_User);
}
Im doing this to block users:
MembershipUser user = Membership.GetUser(username);
if (user != null)
{
user.IsApproved = isApproved;
Membership.UpdateUser(user);
}
how can i get the list of banned users ordered by date they were banned.
View 2 Replies
Similar Messages:
Mar 12, 2011
I am trying to make ActionFilter which redirects banned users to /Error/NoAccess site, so I have ActionFilter:
[Code]....
Before each public class xxxxxxController : Controller I use [NoBannedUsersActionFilter]. But for example on website /Account/LogOff I have error: 'Server cannot modify cookies after HTTP headers have been sent.' and VisualStudio shows me AccountModel.css file and this method:
[Code]....
View 3 Replies
Jan 12, 2010
I have a stored proc which returns months year in nice words, but having problem ordering them:
SELECT count(id) as counter, datename(MONTH, PublishDate) + ' ' + datename(YEAR, PublishDate) as date
from BLG_BlogPost where active=1 group by datename(MONTH, PublishDate) + ' ' + datename(YEAR, PublishDate)
And that returns:
April 2009 (8)
August 2009 (3)
February 2009 (2)
How can i order them?
View 3 Replies
Oct 12, 2010
In my table I have a varchar type column, the values like..
sale_date
04/23/2010
02/03/2010
12/24/2010
I need to retrieve the records in both ascending and descending order. Problem is now it is a varchar type if I use order by o/p like
02/03/2010
04/23/2010
12/24/2010
I tried with convert(DATETIME,sale_date) but no use.
View 4 Replies
Feb 8, 2011
I have a list of ids properly stored in a List<>. I now need to Group list and get a count of the number of occurrences sorted descending.
Example:
List<string> aryIDs = new List<string>;
aryIDs.Add("1234");
aryIDs.Add("4321");
aryIDs.Add("3214");
aryIDs.Add("1234");
aryIDs.Add("4321");
aryIDs.Add("1234");
Would Produce:
"1234", 3
"4321", 2
"3214", 1
This would be easy in TSQL, but I would like to avoid the server roundtrip, unnecessary tables, etc. if possible.
Update: The VB.NET conversion for Ralph Shillington's answer below:
[code]....
View 2 Replies
Aug 11, 2010
I have used Login Control + Change Password + Create User Wizard in my project. Everything is working fine. I want to know that how to get the List of Users and also to Update/Delete users.
View 1 Replies
Sep 16, 2010
Just wondering how to implement a user's list into website ? im using ASP.NET C#. I want to be able to:
add/delete usersadd/remove roles
View 2 Replies
Apr 7, 2010
Technologies involved:
ASP.NET Web-forms
Javascript (jQuery for instance)
Case,To make it clearer let's give the Stackoverflow Users list as an example. This list can be manipulated at client-side. I can search, page and so forth. So obviously we would need to call jQuery.ajax to retrieve the HTML of each page given a search. Alright. Now this leaves me with the first question:
What is the best way to render the response for the jQuery.ajax at server-side? I can't use templates I suppose, so the most obvious solution I think is to create the HTML tags as server-controls and render them as the result of an ASHX request? Nice. That solved we have yet another problem:
When the user first enters the Authors List the first list page should already come from the server completely rendered alright? Of course we could render the first page as well as an ajax call but I don't think it's better. This time I CAN use templates to render the list but this template couldn't be reused in case 1. What do I do?
Now the final question: Now we have 2 rendering strategies: 1) Client and 2) Server. How do I reuse code for the 2 renderings?
View 2 Replies
Jun 6, 2010
Why do I get this nasty error? I have taken a table, and I have made an exact copy to another table. The new table hold the purged records from the other table. I want the records out of my other table to speed up the site. I don't want records from banned sites cluttering up the table.
So my procedure has gotten the thing to write the row to the table, but I get an error about a conversion to an integer. What could this be referring to?
[Code]....
View 3 Replies
Feb 25, 2010
I have a List which contains Dates :
List<string> StringDates;
[0]: "04.03.2010"
[1]: "09.03.2010"
[2]: "11.03.2010"
[3]: "12.03.2010"
[4]: "16.03.2010"
[5]: "18.03.2010"
[6]: "19.03.2010"
[7]: "23.03.2010"
[8]: "25.03.2010"
[9]: "26.03.2010"
Using C# what is the best/shortest way to find out min date / max date from this list ?
Using LINQ is not an option!
View 5 Replies
Oct 26, 2010
I need to develop a page in my applicaiton like the image for the user lists.
I need to get the list of users under a group and need to show likw this.
View 4 Replies
Aug 4, 2010
I have a textbox with a calendar icon next to it. When the icon is clicked a popup form displays the calendar control. I have it set up where they can only select the week ending date(saturday) and that date is displayed in the textbox.
I want to prevent users from editing the textbox. I've tried using the readonly and enabled properties but that doesn't work.
How can I keep users from modifying the date in the textbox?
View 5 Replies
Jul 2, 2010
I am working on a .NET web application and I'm trying to use ajax CalendarExtender for the users to specify a specific date. For some reason, when I click the icon to display the calendar, the background seems to be transparent, shown below:
What could be the reason for this?
I've tried googling it but it seems nobody has worked it out yet.
I've also tried setting up it's z-index property to as high value as 5000000 but still doesn't work.
View 6 Replies
Feb 27, 2010
How do I retrieve list of Active users (with account ids) in IIS 6.
View 2 Replies
Jan 23, 2011
I have a page in my application which always shows updated list of online users. Now, to keep the list-which is stored in application object- updated, i do the below steps
add user to list when login remove user on log off Then to handle browser close/navigate away situations, I have a timestamp along with the username in the collectionAn ajax call every 90 seconds updates the timestamp.
The problem:
I need something to clean this list every 120 seconds to remove entries with old timestamps.
How do I do this within my web application? ie Call a function every 2 mins.
PS: I thought of calling a webservice every 2 mins using a scheduler , but the hosting environment do not allow any scheduling.
View 2 Replies
Dec 1, 2010
I'm writing a program that records time-in and time-out and I have a problem when trying to retrieve data for a specific date.In the table, the "timein" and "timeout" fields have format of "smalldatetime". To record the timein, I insert the system time (by using System.DateTime.Now) into the "timein" field.I want two types of searches.
1) Search records between a date range
2) Search records for a specific date
For example, First, I want to search if there are any records between 11/2/2010 and 12/1/2010. I will ask user to input "11/2/2010" as start date and "12/1/2010" as end date. I will use Convert.DateTime() methods to convert these two input before put them
into SQL query like:
"SELECT * FROM timesheet WHERE timein BETWEEN Convert.DateTime(startdate) AND Convert.DateTime(enddate)"
The output results do not include the date 11/2/2010 and 12/1/2010. I get only the dates in between. I know that is the limitation of BETWEEN. I wonder if someone has a way to work around this limitation.
Secondly, I want to prompt users to enter a specific date like (11/2/2010) and search the table for rows match that criteria. I can't get this to work. I have tried "SELECT * from timesheet WHERE timein LIKE '%searchdate%'", "......timein = 'searchdate'" but none works.
(I'm using VS 2010 C# and SQL 2008 for this project)
View 6 Replies
Jan 21, 2011
I have some code that returns my LastPasswordSet date when I use my administrator account on my development machine using localhost but when I deploy to me test server and I get an exception "Object reference not set to an instance of an object"
[Code]....
[Code]....
Any ideas?
View 3 Replies
Jun 22, 2010
I need to know to get current online user list. How can I achieve. I am using membership concepts that is asp login control.
View 1 Replies
Aug 18, 2010
I have a ASP.NET Website project and I need to list all the users and their groups on my Windows system. I have set the identity impersonation to true and provided the username and password of the admin in the web.config. Where do I start?
Update:
I have the following code at the moment -
var machine = new DirectoryEntry("WinNT://<IP ADDRESS>");
foreach (DirectoryEntry child in machine.Children)
{
// get the child's group(s).
}
When I debug, I can see the list of users in machine.Children. How do I find the group(s) that this user belongs to?
View 2 Replies
Mar 2, 2011
How can I get a list of users from active directory? Is there a way to pull username, firstname, lastname? I saw a similar post where this was used:
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "YOURDOMAIN"); I have never done anything with active directory so I am completely lost.
View 3 Replies
Oct 15, 2010
I need to scrap the email and phone numbers of all the users who 'like' a facebook application.
for example : http://www.facebook.com/home.php?#!/apps/application.php?id=2438981128
The above application contains over 1000 users who like the application. Is there a Facebook API to accomplish this ?
View 1 Replies
Mar 16, 2011
Is there any reasonably efficient way to get a list of users who are not in a specific role?
The only methods I can see are Get all the users from DB and do a check in code
Go directly to the db and sidestep the role provider
View 3 Replies
Sep 22, 2010
i am using membership classes,,, i want to fetch the list of users who are online based on a condition... the condition is that i want to fetch the users with a specified userids... eg i have 10 user's userids and i want to check which of these users are online..
View 6 Replies
Apr 7, 2010
I'm making an aspx page that can edit books. A book is an complex class with lots of properties.
I've made an edit page for most of them, however I'm having trouble with showing edit options for my Sellers Proprety. It is an list<Seller> object.
Seller is as follows:
public class Seller
{
private string sellerName;
private double price;
}
How can I print a list to the screen, and let the clinet edit it, then load it back to the object?
View 2 Replies
Oct 23, 2010
Given a particular user group id, how can we most quickly retrieve the list of users under that user group id?
View 2 Replies