Tuesday, June 30, 2009

ASP.NET Utility to create SQL Server Database for Membership and Roles Management

Ok, ok. I always forget so to save me some time, here it is...

Open up command line from Visual Studio, then run... cmd>aspnet_regsql.exe

Then execute the following...

-- Register Application
EXEC dbo.aspnet_Applications_CreateApplication 'AppName', NULL

-- Check if Application was registered
SELECT * FROM dbo.aspnet_Applications

-- Create a Role
EXEC dbo.aspnet_Roles_CreateRole 'AppName', 'Administrator'

-- Check if Role was created
SELECT * from dbo.aspnet_Roles

-- Add myself as Admin
DECLARE @Date AS DATETIME
SET @Date = (SELECT GETDATE())
EXEC aspnet_UsersInRoles_AddUsersToRoles 'AppName', 'DOMAIN\username', 'Administrator', @Date

-- Check if I got added as Admin
EXEC dbo.aspnet_UsersInRoles_GetUsersInRoles 'AppName', 'Administrator'

Sunday, June 28, 2009

Google App Engine Notes

Development console is here:
http://localhost:8080/_ah/admin/

Wednesday, June 24, 2009

Google App Engine Steps in Adding New Functionality

I sure want to take note. Just so that I don't forget. I got this from this book entitled Using Google App Engine.

In order to add a new functionality to our application, take the following steps:

  1. Decide on the URL that you want to use for the new feature.
  2. Write a new handler—the handler can initially be simple and just handle a GET request that renders a new template.
  3. Add a routing entry in main() to send the URL to a new handler.
  4. Add new templates as needed.
  5. Update the _base.htm to add any new navigation that is needed.
  6. Build the rest of the handler code and test your new functionality.

Thursday, June 04, 2009

CSS Blues

Ok, ok, I'm no designer so I don't know much about CSS. Whenever I needed to work on CSS, I google. Well I think working on CSS is both easy and difficult. Easy because it's mainly just formatting, difficult because it's frustrating at times especially when working on something that works in one browser but not on the other. Or something that works in one version but not on the other version.

Well, I just want to take note of what my CSS code looks like that works on 3 browsers, IE8, IE6 and Firefox3.

I commented the codes I added to make it work in IE6. I'm explaining this later on when I have time.

#container

{

    width: 100%;

    margin-top: 2em;

}

 

#content

{

    margin-right: 295px;

    overflow: hidden; /* IE6 cure */

    height: 100%; /* IE6 cure */

}

 

#nav

{

    float: right;

    width: 250px;

    padding: 1em;

    border: 1px silver solid;

}

 

table

{

    margin-left: 1px; /* IE6 cure */

    width: 99.9%; /* IE6 cure */

    border-collapse: collapse;

    border: 1px solid #7bb1db;

}