Saturday, May 29, 2010

Importance of Design Patterns

I’m not a computer scientist. I’m also not one of the many über programmers that create and analyze software frameworks and techniques. I simply design and develop software that attempts to meet my customer’s needs. To that end I’m always looking for the best tools available to get the job done.

Jeremy Miller states the importance of design patterns well.

I know many people blow off design patterns as ivory tower twaddle and silly jargon, but I think they’re very important in regards to designing user interface code. Design patterns give us a common vocabulary that we can use in design discussions. A study of patterns opens up the accumulated wisdom of developers who have come before us.

You don’t need to be a rocket scientist to understand design patterns. Most are just common sense. Complex patterns are designed to solve complex problems. Design patterns should be thought of as a tool that you use just like any other. Don’t let the ‘ivory tower twaddle’ scare you away.

I think most people would agree that one of the key components to creating a successful software product is quality. I’ve developed .NET applications in the past and have experienced the difficulty of testing and maintaining the functionality of WinForm forms and components when they are created with the default Visual Studio tools.

If you’re not careful, here’s what you end up with.

Monday, April 5, 2010

No device or emulator visible in 2010 Express for Windows Phone CTP

I was using 2010 Express for Windows Phone. I was trying to debug the application but I get an error "Exception from HRESULT: 0x89721800". I was pulling my hairs out! Thanks to MSDN, here is the solution...

Run "VS 2010 Express for Windows Phone" as administrator. Check out Windows Phone Developer Tools release notes - section "Installation" #6:

"6. When you install the tools as an administrator and then you try to run the tools from a normal user account, deployment to the emulator fails. Workaround: keep running the tools as an administrator or change the privileges of the c:\programdata\microsoft\phone tools\corecon\10.0\addons\ImageConfig.xsl file so that all accounts can read it (i.e. everyone)."

http://download.microsoft.com/download/D/9/2/D926FB38-BB43-4D87-AE5A-1A3391279FAC/ReleaseNotes.htm#tag_installation

Sunday, February 21, 2010

Mixed Mode Authentication for SQL Server 2005 Express Edition

For SQL Server 2005 Express Edition, there is not GUI tool available to configure the server. You need to go it manually. The first step is to change the login-mode.

Open registry editor (launch application %WINDIR%\regedit.exe) and go to HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer in the tree on the left.

On the right, look for an entry named LoginMode. The default value, when installed is 1. Update it to 2. The next step is to restart the service.

Launch your Service Manager (Start -> Run -> Type services.msc) and look for a service named MSSQL Server (SQLEXPRESS). Restart the service.

Hey! We are not done yet... at least practically. We need to add a user with administrative priviledges so that the database can be accessed from ASP.Net.
On the command prompt, login to SQL Server command prompt using the osql utility. SQL Server 2005 Express Edition is installed with the instance name SQLEXPRESS. Use the following command to login:

osql -E -S .\SQLEXPRESS

One the SQL-command prompt, execute the following?

1> exec sp_addlogin 'username', 'password'
2> go
1> exec sp_addsrvrolemember 'username', 'sysadmin'
2> go
1> quit

Replace the username and password but not forget the quotes. To verify, try login using the following on the command prompt:

osql -S .\SQLExpress -U username

Provide the password when asked for and you should be through!