Give a user execute permission to all Stored Procedures of a Single Database (MSSQL)

System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object …

This usually happens if the user does not have execute permission on the stored procedures  that the application is calling.

While there might be many different ways to handle this issue, the easiest way that i found is to :


1. First Select your Database

USE DATABASE ycsoftware

2. Create a database role for that database let’s say :

CREATE ROLE db_execute_stored_procedures 

3. Give execute permission to that role

GRANT EXECUTE TO db_execute_stored_procedures 

4.  Add the the user (the db user the application is running as) to the role.

EXEC sp_addrolemember ‘db_execute_stored_procedures’, ‘ycsoftware_user’


Reference :

http://msdn.microsoft.com/en-us/library/aa259605(v=SQL.80).aspx

http://msdn.microsoft.com/en-us/library/aa833199(VS.80).aspx


Internet URL Regular Expression

The ASP.net Internet URL Regular expression is not complete and i was surprised the other day when an application that i have written stopped working suddendly. The form would not submit because it thought that the URL below was wrong.

http://ycsoftware.net/careers/job_search.aspx?flag=true&User_ID=&Locale=&arrCountry=United%20States&arrState=CO;arrCompany=>Ycsoftware%20Freight;&strKeywords=SoftwareEngineers

The Build in regular expression does not expect “semicolon” in URL. I have found the regular expression below online and it seems to work fine for me. Give it a shot

 

Internet URL Regular Expressions

(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?

Reference:
http://regexlib.com/

Change TrixBox maint Password

I have played around with Trixbox, but i have not been able to locate where to change the “maint” password within the GUI.

To date there is only one way to change the “maint” password: “SHELL”

To Change the password, you have to shell into your TRIXBOX and  use the “passwd-maint” command


Disable Keyboard Prompt on Boot Compaq Servers

The solution to this issue is to run the server in “Server Mode“.

Get into the BIOS by Pressing on F10 on Boot

Go to the Security menu -> Power-On Password -> Set A password -> F10

Go Back to Security menu – > Password Options -> Network Server Mode -> Enabled.

Hit F10 -> and Save the BIOS changes