Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.

Showing posts with label C# Stored Procedure. Show all posts
Showing posts with label C# Stored Procedure. Show all posts

Tuesday, December 23, 2008

Get the ApplicationName for Stored Procedure Parameter

Sometimes the ApplicatonName is necessary for Membership stored procedures. You can access the ApplicationName as follows:

string appName = Membership.ApplicationName;


References: http://msdn.microsoft.com/en-us/library/system.web.security.membership.applicationname(VS.80).aspx

Be Careful About uniqueId Parameter in Stored Procedure

Here is an error I received when my UniqueId parameter in a stored procedure was not valid:



Server Error in '/stockmonger.com' Application.
Conversion failed when converting from a character string to uniqueidentifier.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting from a character string to uniqueidentifier.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


I corrected to make sure the parameter was a valid uniqueId paramater and not null.