
Hello Karthik2010_Mca
What kind of Error Message you are talking about, is it any error thrown by the stored procedure
then use try/catch block
check this
Over here i have a global string variable errdesc=0;
On button Click i am executing the procedure
protected void btnUpload_Click(object sender, EventArgs e)
{
try
{
SqlConnection con = new SqlConnection(strconn);
con.Open();
SqlCommand cmd = new SqlCommand("InsertPowerPoint",con); // Stored Proc Name
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@PowerPointName",SqlDbType.VarChar).Value = filename;
cmd.Parameters.AddWithValue("@PowerPointPath",SqlDbType.VarChar).Value = pptpath;
cmd.ExecuteNonQuery();
xErr.Text = "Uploaded Successfully"; // If No Error then Uploaded Successfully
xErr.Visible = true;
FillGrid();
}
catch (Exception ex)
{
errdesc = ex.Message;
xErr.Text = errdesc; //any error from SP then It will show in Label after catching the error in exception.
}
}
Hope this will help
Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved
Karthik2010_Mca, if this helps please login to Mark As Answer. | Alert Moderator