Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
C#
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

C#
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
Updated 10-Oct-12 3:02am
v2
Comments
[no name] 10-Oct-12 9:35am    
Okay so? Display it as a message then. What is the problem?
Member 8155568 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 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900