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


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How to access triggers error message in asp.net..

Posted By: susant     Posted Date: September 28, 2008    Points:2   Category :ASP.Net
This is the TRIGGER that i wrote in SQLSERVER.. The user cant update phone number...

Create TRIGGER checkph on customers
for update
as
if update(phone)
BEGIN
RAISERROR('U cant update PHONE NUMBER',10,1)
ROLLBACK
end


my requirement..
1: I have one page called reg.aspx so there is one button update profile...
so when the user want to update phone no in my reg.aspx page then how to show the error message to the end user in asp.net......


Any body can help my mail id: susantaown@gmail.com

ThanX
susant

Responses
Author: Amit Mehra             
Posted Date: September 28, 2008     Points: 5   

Hi,
try like this


try

{

//Your Code to call DataLayer

}
catch (SqlException ex)
{
string errorMessage= ex.Message;
int errorCode= ex.ErrorCode;
}



Thanks,
Amit
Please "Mark As Answer " if this post help you.


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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