Monthly Archives: January 2011

ASP.Net Membership add user & role utility

How many time do find you can’t easily add new user to your application when deploying. It’s ironic that you have built an application with a complete user management features but can’t get it to work because you need to login the first time around to access the features.

Or may be you can’t be bothered to create one, just want to create a few roles or users. We all know that we can’t  make ASP.Net web admin tools to work on a remote site.

This utility is meant to add a new user or roles to your newly create aspnet identity database.

to use just compile the source with .Net 4.0. the use this command line switchers


To add new user

  • -u username
  • -p password
  • -e email
  • -r role (if you have more than 1 role for the user, do it multiple times)
  • -c the path to the configuration file, i.e. your web.config

To add new roles

  • -r roles
  • -c the web.config file

This work by creating a new appdomain, and loading the config file , since there’s no programmatic way to access the Membership features(or I just can’t find it). See the source for details. You can safely delete the app.config


Download the source here


SQL Server Spatial

Learning SQL Server spatial.

Microsoft SQL Server, has had supported for spatial for quite sometime. It never really interest me until recently when we are working on mapping system. It’s all started when we were task to do project management consulting for LLM which is responsible for the country toll highways. It’s a pain to watch those guys working with spatial object in Oracle.

From then on we know, that we can’t ignore this. With the emergence of web mapping services such as Google Map and Microsoft Bing Map, couple with the affordability and ubiquity of GPS enabled devices. Microsoft SQL Server spatial is made easy if you are .Net developer and understand the concept of CLR and it’s hosting. From .Net developer point of view it’s just another class , another datatype, with a set of inheritance, properties and method.

Part 2