|
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...
there are a few ways to compare days, or return the first day of the month in sql server.
read more...
There are a few ways to handle expiration using FormsAuthentication in .NET.
here are three approaches...
read more...
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...
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...
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...
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...
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...
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...