May 2008
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Search

 
Catagories
Archives
Recent Entries
Links
RSS

April 26, 2004

roles using windows authentication

Catagory: programming · This Entry · Comment(0) · eMail entry · Google
programming

There's a similar approach with windows authentication, as with forms authentication. You still have to manually assign the users/roles in WindowsAuthentication_Authenticate to get the full benefit of user and role verification using parameter attributes - or web.config user/role declarations.

Here's the code (in vb) to map the values in...

read more...
 
Posted by 7hz at 03:04 PM | Comments (0)

April 22, 2004

date comparison / first of month

Catagory: sql server · This Entry · Comment(0) · eMail entry · Google
sql server

there are a few ways to compare days, or return the first day of the month in sql server.

read more...
 
Posted by 7hz at 05:59 PM | Comments (0)

sliding expiration with formsauthentication

Catagory: programming · This Entry · Comment(1) · eMail entry · Google
programming

There are a few ways to handle expiration using FormsAuthentication in .NET.

here are three approaches...

read more...
 
Posted by 7hz at 03:54 PM | Comments (1)

April 19, 2004

rename or (force) drop database

Catagory: sql server · This Entry · Comment(0) · eMail entry · Google
sql server

here's a way to rename, or force a database drop. i'm not sure if you need or want the rollback transaction lines. but here you go...

also on renaming, you could dettach the database, move the data / log files, then reattach.

read more...
 
Posted by 7hz at 05:01 PM | Comments (0)

April 15, 2004

it's your birthday...

Catagory: sql server · This Entry · Comment(0) · eMail entry · Google
sql server

here's a way to calculate someone's age on a given date. also, you can also sort by birthday (month/day) excluding the year.

the query just performs a datediff, BUT adjusts by 0/1 given the time of year -- before or after the person's birthday.

i.e. you just need to adjust by "-1" if the date you're evaluating is prior to the birthday in that year.

read more...
 
Posted by 7hz at 04:32 PM | Comments (0)

April 13, 2004

can't log into database?

Catagory: sql server · This Entry · Comment(0) · eMail entry · Google
sql server

This throws me off now and then. I quickly create a database in EnterpriseManager then run a script to create objects using Query Analyzer. Since I can to log in as 'sa', everything seems fine -- but I can't log in using a connection string even though 'sa' *should* be the dbo for the database. so what's going on? there's a catch.

read more...
 
Posted by 7hz at 02:42 PM | Comments (0)

April 01, 2004

large map printing (using mappoint)

Catagory: gps · This Entry · Comment(2) · eMail entry · Google
gps

I used mappoint to make a large 36x36" map print out using a plotter. to get some extra detail, i modified the mappoint binary to accept a higher pixel limit when generating the map image (using 'save as web page').

i used this to print out a wall (poster) size map of the entire greater portland area, including street detail. looks really nice.

read more...
 
Posted by 7hz at 01:48 PM | Comments (2)

check for daylight saving time

Catagory: sql server · This Entry · Comment(3) · eMail entry · Google
sql server

This procedure uses the sDayOfMonth procedure, to get the calendar day, then checks if that day is subject to daylight saving time.

This procedure is only accurate to the "day" and not the *hours* prior to the change at 2am (which was just fine for my application).

read more...
 
Posted by 7hz at 11:35 AM | Comments (3)

determine the calendar day of month

Catagory: sql server · This Entry · Comment(0) · eMail entry · Google
sql server

Here's a stored procedure that returns the calendar "day of month number", given the year, month, and occurance (1st,2nd,...) and the day of week in question (sunday,monday,...).

I used this for another procedure that determines if daylight saving time is in effect on a given day. see the notes regarding validating input for other use cases, but it should be quite useful.

read more...
 
Posted by 7hz at 11:26 AM | Comments (0)