Categories
ASP.NET DotNet Evangelism Microsoft Technology Web Development

Searching Users with ASP.NET Membership Database

In my previous post, we have successfully bind the Membership.GetAllUsers() method to a databound control such as the GridView to enable paging and sorting. This time, I am building a mechanism that will allow me to search for users in the ASP.NET Membership database. By default, ASP.NET Membership supports searching by specific matches: email (Membership.FindUsersByEmail()), user id (aka provider user key), and by username (Membership.FindUsersByName()). There’s no built-in mechanism wherein you can query for users that contain specific characters — say you want to get users that starts with a specific letter or contains certain characters.

Examining closely the ASP.NET Membership database (either created by the WSAT or configured using the aspnet_regsql.exe), it has stored procedures that performs various queries to the ASP.NET membership. I tweaked one query to get the result that I wanted and stored into a new stored procedure and named it “Membership_QueryUsersByLetter”. This stored procedure should reside on the same database of your ASP.NET Membership.

CREATE PROCEDURE [dbo].[Membership_QueryUsersByLetter]
    @SearchKey nvarchar(256)
AS
BEGIN
    SELECT u.UserName, m.Email, m.PasswordQuestion,
	m.Comment, m.IsApproved,
	m.CreateDate,
	m.LastLoginDate,
	u.LastActivityDate,
	m.LastPasswordChangedDate,
	u.UserId, m.IsLockedOut,
        m.LastLockoutDate
    FROM
	dbo.aspnet_Membership m, dbo.aspnet_Users u
    WHERE
	u.UserId = m.UserId AND u.UserName LIKE '%' + @SearchKey + '%'
    ORDER BY
	u.UserName
END

This query assumes that the ASP.NET membership database is configured for one application only. A sample application that you can use for this one can be downloaded here. Rename the file (searchusers.odt) to a zip extension file to extract files. Note however that you need to modify the connection string to match your current machine configuration to point to an ASP.NET membership database (or ASP.NET Membership configured database).

Categories
Filipino Future Goals Love Mushy Personal Relationships

Twenty Questions

20.jpg

I chanced across a blogpost of my colleague with regards to a short play that tackled life, love, sex, and relationships called “Twenty Questions” that won itself a Palanca Award (2004 Palanca Awards 2nd Prize winner for “One Act Play in Filipino”).

The play is written in Filipino and for most young adults, the theme is apt with the current things that happen in our everyday lives. So as not to flood my blog entries with the whole text of the play, I created a separate page for the “Twenty Questions” play. I really like certain lines from the play that I guess makes a sound impact to the readers.

YUMI: Maturity has nothing to do with age.

JIGS: But it has a lot to do with time.

You can read more about the play from the author in this blog post.

Life is too precious para lang daanin sa trial and error.

Categories
Boredom Finance Philippines

Random Thought For The Day

The reason why my Monday mornings are somehow bright despite the odd things that I face going to work is my workout. It “refreshes” my mind for the week ahead and I always look forward to it. At the least, before you go to the office and start doing work, you’ll be cleared of any things that could disrupt work. While working out, my mind became green out of the blue because of the then issue of changing the Philippines’ name to “Maharlika”. Searching google, it will give some relevant results and the links can be found here, here, and here.

Currently, Filipinos are referred to as “Pinoy/s” which is a slang derived from the first syllable of Philippines/Filipino plus the suffix “-noys”, which I believe refers to being a Filipino. Likewise, Filipino-Chinese are called “Tsinoys”, of which it came from  the first syllable of the word “Chinese”.

If Philippines would be renamed to “Maharlika”, as others suggest, then we would change our slang identification to “Manoys” (taken from the first syllable of the name again plus the “suffix”) – something the Filipino women won’t be proud of.  😛

Are you OK to be called a “Manoy” for male or “Manay” for women? 😛

Categories
Canon Photography

Canon 450D Announcement

canon450d.jpg

(Image courtesy of dpreview)

Yesterday, Canon has announced it’s new camera, Canon 450d which is the successor to my camera, the 400D. In a nutshell, features of the camera are the following:

  • 12.2 Megapixel CMOS sensor (10.x MP for 400D)
  • Canon’s EOS Integrated Cleaning System
  • 3.5 frames per second (3 frames for 400D)
  • 3.0” LCD with Live View shooting (2.5″ without Live View for 400d)
  • 9-point wide-area AF system with f/2.8 cross-type centre point (no Spot metering for 400d)
  • Picture Style image processing parameters
  • DIGIC III image processor (DIGIC II for 400D)
  • Digital Photo Professional RAW processing software
  • Compact and Lightweight body
  • Fully compatible with all Canon EF and EF-S lenses and EX-series Speedlites
  • SDHC support (CF for 400D)

The camera has a nice set of features yet it’s not that compelling for me to upgrade bodies. For one, I am not impressed with the LCD – yes it’s size was increased but that means stronger battery consumption and even if they say that the battery of this camera has increased capacity, I guess the lifespan of the battery would boil to the same with that of the 400d. Also, same number of pixels for both 2.5″ LCD and 3.0″ LCD means that there are less photo detail in the LCD of the newer models.

At any rate, I am quite happy with my current toy and if ever I’ll upgrade, it will not be in the near future (unless there are angels who would give me these toys for free :P) But, with a larger body frame, I guess ergonomics would be better. The camera is yet to be released to the public but once this gets into Philippine shores, I’ll try one and check on the differences.

For more information, you can check out these helpful links:

Canon Japan 450D Official Site

Canon UK 450D Press Release

Canon USA 450D Press Release

Digital Photography Review (dpreview) 450D

Digital Photography Review 450D Hands-On Review

Categories
DotNet Evangelism Microsoft Philippines PhiNUG Technology

PHINUG is back online!

I am pleased to announce the availability of PHINUG.org again. The site was down for quite a while (if you think 4 months is) and has undergone a complete reconstruction from ground up.

Certain sections of the site is still unavailable however, if you want to be part of this organization, all you need to do is to sign-up for free! We will be upgrading the site to facilitate more features for the members. The site is actually back to its infancy stage but we’re sure there’s still more to come for the site.

If you are a .NET software developer, a developer who wishes to learn .NET, or students interested/keen on learning .NET technologies, you can register yourself now.