I have created a login and a user on a database using SMO. I am having trouble mapping a database to the login. When you create a login from the GUI using SQL Server Management Studio Express CTP the user is automatically created and the database is mapped to this login from the user mapping tab. When I create the login programmatically this is not the case so I need to create the user. How do I map the database to the login. I set the default database property on the login but this does not do it.
Thanks,
Michael Gustafson

Mapping a user to a login
Dave B..
what property of the Login is used to show what databases are mapped
also is there a way with SMO to check and see if a password is blank Granted the odds of that are extemely slimmer with 2005.
jjswildfire
Lee_Dale
I found the DatabaseMapping() class and was able to find which logins were missing mappings. Im still at a lost at how to test for blank passwords using SQL2005 and SMO.
Thanks for taking time to read this.
Chuck Turner