.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to retrieve an error from SQL

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :ASP.Net


I am trying to retrieve errors from SQL like so:

DECLARE @debugerrormsg nvarchar(MAX)

	SELECT L.ID, L.Name FROM Lookup L WHERE L1.ID = 1
SET @debugerrormsg = ' + ERROR_MESSAGE() + ' at line ' + cast(ERROR_LINE() as varchar)
RAISERROR(@debugerrormsg, 16, 16)

So you can see that "L1" is wrong so this i'm expecting to output the error and the line number but it does not work. For some reason it does not show the line number..

Any ideas what i'm doing wrong?

Kind regards,

View Complete Post

More Related Resource Links

failed to create. Operating system error 5(failed to retrieve text for this error. Reason: 15105)

Hi, OS: Windows 2008 R Database: SQL Server 2008 We have SSIS package installed on the SQL Server 2008, one of the task in SSIS package backs up database to the "E:\M1G3Datastore" drive. This pacakage was working fine for the last 4 months, this morning the task that backs up the database fails, the error message is: BackupDiskFile::CreateMedia: Backup device 'E:\M1G3Datastore\M1Test.bak' failed to create. Operating system error 5(failed to retrieve text for this error. Reason: 15105). The following query work, this query backs up the database to C drive and it works: BACKUP   DATABASE [M1Test] TO DISK = N'C:\M1G3Datastore\M1Test.bak' WITH   NOFORMAT, INIT, NAME = N'M1Test-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO THE FOLLOWING QUERY DOES NOT WORK, PLEASE NOTE THE DRIVE IS CHANGED TO "E" IN THIS INSTANCE     BACKUP DATABASE [M1Test] TO DISK = N'E:\M1G3Datastore\M1Test.bak' WITH   NOFORMAT, INIT, NAME = N'M1Test-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 GO  Please help, and MANY thanks in advance   sword

The variable cannot be found. This error occurs when an attempt to retrieve a variable error from



Sometimes when executing a package (SSIS 2005) from .net users get the error below. What could be the problem?


The variable  cannot be found. This error occurs when an attempt to retrieve a variable from a variables collection on a container during execution of the package occurs, and the variable is not there. A variable name may have changed or the variable is not being created.

SharePoint 2010: PPS Dashboard Designer cannot retrieve application. authentiation error


I am getting this error when I try to open the dashboard designer in Sharepoint 2010/PPS.  This is from the out of the box site collection found under http://mywebsite/site/Pages/ppssample.aspx

This used to work.  Whare are the best ways to go about troubleshooting this?

one note? i can connect great via my web server (remote desktop/locally on server) but not from my laptop from my desk.

 Following errors were detected during this operation.
 * [9/28/2010 3:41:01 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
  - Downloading https://mywebsite/_layouts/ppsma/1033/designer.application?Operation=OpenWebsite&SiteCollection=https://mywebsite/sites/myApp&SiteLocation= did not succeed.
  - Source: System.Deployment
  - Stack trace:
   at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
   at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
   at System.Deployment.Application.FileDownloader.Download(Subsc

error : Unable to retrieve folder information from the server. (550).


I now get this message in Visual Studio  2010;


error : Unable to retrieve folder information from the server. (550).


help please

An error occurred while attempting to retrieve the KPI value from the list


I created a KPI based on a custom view, and this works fine. Then I change the view (I display all records instead of filtering) and then I get this strange effects :
- Or the KPI saves correctly, but shows this "The specified view of the SharePoint list does not exist" message on the KPI list page
- Or the KPI refuses to save displaying "An error occurred while attempting to retrieve the KPI value from the list" in the Status Icon section of the KPI edit page.
Could it be that some records contain values that SP cannot interpret within KPI, even if they don't cause any problem in the view itself ?

I'm not a SP developper, so if someone could have a clue without code...

Thanks a lot for your help

Error while merging: "Could not retrieve column info from table tablename" and Could not find stored


Hi i am getting following error message while merging. Can any one please help?

We are using sql server 2005
I have this problem in publisher.Gone throught his article http://social.msdn.microsoft.com/Forums/en/sqlreplication/thread/b0bbc330-91df-45d5-8dbf-e2df461a8005 but no luck.

The merge process could not retrieve column information for table 'dbo.tablename'. Verify that you have sufficient privileges on the database and retry the operation. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201016)
Get help: http://help/MSSQL_REPL-2147201016

Could not find stored procedure 'dbo.MSmerge_sel_sp_6481B06512B54C91FCC171C542E7'. (Source: MSSQLServer, Error number: 2812)
Get help: http://help/2812


Content Editor WebPart error "Cannot retrieve properties at this time"


I've found a similar post: http://social.technet.microsoft.com/Forums/en/sharepointadmin/thread/fc9b388c-2a16-436c-afb4-b6d06b2f5fe5...but i don't have the same errors on the event log.

- SP2 installed already

- Recyle Application Pool works but only temporarily ... it keeps happening again

I have the following and any help would be much appreciated!!!


Event Type: Error
Event Source: Office SharePoint Server
Event Category: Office Server Shared Services
Event ID: 6482
Date:  10/13/2010
Time:  4:13:34 PM
User:  N/A
Computer: XX1
Application Server Administration job failed for service instance Microsoft.Office.Server.Search.Administration.SearchServiceInstance (a21cc2ec-8b2b-4ee1-bcc6-d971a5dcc263).

Reason: The trust relationship between this workstation and the primary domain failed.

Techinal Support Details:
System.SystemException: The trust relationship between this workstation and the primary domain failed.

   at System.Security.Principal.SecurityIdentifier.TranslateToNTAccounts(IdentityReferenceCollection sourceSids, Boolean& someFailed)

Error while adding 3rd node to a cluster --- Failed to retrieve data for this request.


Inside a virtual environment running Windows 2008r2 Ent SP1 and SQL 2008r2 RTM.

Inintial cluster build has gone smoothly for a 2 node cluster using iSCSI. Added up a third node to this cluster manually changed quorum model and MsDTC resource was bouncing all well on the three nodes. Sweat started when the third node failed to add into SQL Failover cluster with the given message "Failed to retrieve data for this request" right after clicking add a node.

Sites talk about adding CuP6 and to lower the security but to note all this worked for first & when adding second node, for the moment this was resolved for me after I restarted all the nodes; going from Node3 to 1. For a moment RemoteRegistry service failed to start on node2 and it wount work even on restarts so moved every thing to node1 now the RPC was up on Node2 and I can go further on adding node3 to SQL cluster but as I'm typing it failed again.

As I check the logs they point about failures to write to registry and at time Network Path not found, User credentials used are all same and pings are going well for the entrire set of IP's I have.

Any insights on this are highly appreciated?


IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


Handling 404 page not found with Error page



      How do i handle 404 page not found?

Inserting personal error message in ValidationSummary



I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:



Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

        public static string aaa(int i)
            return i.ToString();

        public static string aaa1(int i)
            return i.ToString();



        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        <span id="displayspan"></span>
        <br />
        <input type="button" value=

Jscript error: Object does not support property or method


 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo

Type or namespace error.


A couple of days ago I started getting an unusual behavior when compiling Website projects. I have referenced class libraries added to my bin folder that are also correctely referenced in using statements in my aspx.cs code behind. When I compile, I get the 

Error 4 The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Dev\Fiscal_Portal\Implementation\FMS Portal Site_new\App_Code\BLL\DataTables.cs 1 7 C:\...\FMS Portal Site_new\

The type or namespace name 'CommonClassLibrary' could not be found (are you missing a using directive or an assembly reference?)

error message that would typically be received when the dll has not been added as a reference or added in a using statement.

I can eliminate the error by adding an


HTTP Error 403 - Forbidden


(VB Express website directed me to ASP.NET Web Services which in turn redirected me to this forum).

 Hopefully someone can help me here...... 

I am using VIsual Web Developer and downloaded the small business application to use as a starting point to help my wife get a website up for her small business. When I load the application, I can F5 and it runs fine but as soon as I make any modification to the app and hit F5, I get the HTTP Error 403 - Forbidden when it tries to show the website.

I notice a pop up that occurs when I run that allows me to choose the link for my app and it displays correctly (I close the webpage that has the error on it).

This seems like a pain, is there a setting I'm missing - I would think that this should "just work".

What's up?????



Webmatrix error


When i try to do anything in webmatrix it shuts down.   i get this error in the log

pplication: WebMatrix.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Unrecoverable system error.
   at System.Environment.FailFast(System.String)
   at MS.Internal.Invariant.FailFast(System.String, System.String)

Insert Error not helpful



I am using VS2010

When I try to updated or insert a record in my User table I am getting an error that does not make sense to me and I cannot figure out what is wrong.

Also, when I try to insert a new record I get a validation error saying that the Id is required. However it is an identity field in the db so it should not be necessary to send it to the server.

Could you please shed some light?


An error has occurred.
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: Microsoft.Web.UI.WebControls.EntityOperationException: An error has occurred.

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. 

Stack Trace:

[EntityOperationException: An error has occurred.]
   Microsoft.Web.UI.WebControls.DomainDataSourceView.PerformCudOperation(ChangeSetEntry operation, Action`1 operationPerformingEvent, Action`1 operationPerformedEvent) +331
   Microsoft.Web.UI.WebControls.DomainDataSourceView.UpdateObject(Object oldEntity, O

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend