Wednesday, August 17, 2011
I'm setting up a new site, and trying out the EF4.1 Code First method. One thing that occurred to me was the using the Entity Initializers to regenerate the DB leads to the asp_net membership tables (and also any sessions state tables) getting zapped.
My preferred strategy is to override the Seed in my EntityInitializer class (which inherits CreateDatabaseIfNotExists) and execute the aspnet_regsql command to recreate the tables in the database.
See my article for more: http://blog.jonegerton.com/articles/ef4_1_code_first_and_the_asp_net_membership_service.aspx
Monday, July 25, 2011
I was looking for a method to easily find the last instance of a search string within a longer string.
I found a few instances of ways to do this that involve functions that loop through until no-more instances of the search string are found and some mention of using the SQL 2005+ Reverse function for single character searches.
What wasn't mentioned is that the method of using the Reverse function can be extended/generalized to search for SubStrings of varying lengths.