Click here to Skip to main content
11,429,154 members (62,833 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 ASP.NET
DataTable dtAttributes = objDAL.GetCPRAttributes();
        foreach (DataRow row in dTableSql.Rows)
        {
            DataRow[] rows = dtAttributes.Select("Attributes='" + row["Attributes"] + "'");
 
            if (rows != null && rows.Length > 0)
                count++;
        }
        if (count < 13)
        {
            throw new Exception("Invalid Excel");
          
           
        }

here i used throw new exception...this is my code in BAL ....i want this exception in the front end ....

in the cs page

catch (Exception ex)
       {
 
           Console.WriteLine(ex);
       }
i had something like this
here its catching my exception

But i want to be displayed as a message ..
Posted 10-Oct-12 3:24am
Edited 10-Oct-12 4:02am
(no name)181.6K
v2
Comments
Wes Aday at 10-Oct-12 9:35am
   
Okay so? Display it as a message then. What is the problem?
Member 8155568 at 11-Oct-12 4:06am
   
It was catcging the messg but not showing .I had put a label and displayed finally.anyways thanks
n.podbielski at 11-Oct-12 3:20am
   
Maybe the problem is writing message to Console in ASP.NET application?
Should you use Page.Response.WriteLine? Or I am missing something?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.150428.2 | Last Updated 10 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100