try
{
DataTable dt = new DataTable();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["myConnectionString"].ToString());
SqlDataAdapter sda = new SqlDataAdapter("Select * from CustomeDetails", con);
sda.Fill(dt);
GridView1.DataSource = dt;
GridView1.DataBind();
}
catch (SqlException d)
{
//Display Error Message
}
How can i display the error message, If there is any error in try block for example, In my Code "Invalid Object name CustomeDetails" is a error. same way I have to display all errors which occurs in try block. I apologize for my English. Note : I have to display all these error messages in web page.