-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: vananthu007
Message 4 in Discussion
Manoj,
Create a hashtable with a code and Error description in global.asax file in
Application_Start event. It looks like this
Example
protected void Application_Start(Object sender, EventArgs e)
{
System.Collections.Hashtable Messages = new
System.Collections.Hashtable();
Messages.Add("ERR01","Ensure all the components are
installed properly");
Messages.Add("ERR02","file is write protected");
}
Then write a seperate class with properties which gets Code as a parameter and
displays the Description of the error.
then in the business layer in the catch block create the instance of the Class
object and send the code and get the description. Thro the error message to the
presentation layer. The try catch layer in the business layer should be like
this,
public class cMessage : System.Exception
{
string strMessageCode;
string strMessageDescription;
public string MessageCode
{
get
{
return strMessageCode;
}
set
{
strMessageCode=value;
}
}
public string MessageDescription
{
get
{
return strMessageDescription;
}
set
{
strMessageDescription=value;
}
}
public string GetDescription(string Code)
{
... Your code
}
In the business layer
try
{
................................
...............................
}
catchcatch(cMessage msg)
{
throw msg;
}
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]