When attaching a database in SQL Server 2008, a user might get the following error.
TITLE: Microsoft SQL Server Management Studio
Cannot show requested dialog.
Parameter name: nColIndex
Actual value was -1. (Microsoft.SqlServer.GridControl)
The default solution that is listed on the sites  &  is use a user a user with sysadmin. It does resolve the issue; but why?
Digging into it a bit, I found when attaching a database SQL Server executes few extended stored procedures. These stored procedures can only be executed by sysadmin role, therefore when someone with just dbcreator permissions try to attach the database it fails. The actual error is this …
xp_regread() returned error 5, ‘Access is denied.’
So I decided to dive into books online to confirm I am not getting forgetful, Books Online state for sp_attach_db “sysadmin and dbcreator fixed server roles can execute this procedure’.So I decided to execute following command:
EXEC sp_attach_db @dbname = 'DBName', @filename1='D:\MSSQL10.MSSQLServer\MSSQL\Data\DBName.mdf', @filename2='E:\MSSQL10.MSSQLServer\MSSQL\LOG\DBName_log.ldf'
It attached successfully, so it seems like an issue in GUI only.
I have tried to look for KB article to see if there is a fix for this; also on Microsoft connect with no luck. So I have a Microsoft Connect article here.
 How to change SQL Server login default database through SQL Script. Jeff Widmer’s Blog. Link.
 Unable to attach database using Management Studio. MSDN Forums Online. Link.
I stilll can’t get it working. I’m getting the error:
Msg 262, Level 14, State 1, Line 1
CREATE DATABASE permission denied in database ‘master’.
That is a very strange message to get, if you can’t create the master database SQL Server does not work. My post was regarding a different issue, however in your case. Please confirm that SQL Server Service Account has full access to the folder where your master.mdf and master.ldf files are located.