Hi
With this code below, i get the number of the SqlException error. But i want to see the full message instead of the error number. For instance, instead of getting error number 207, i would like to get its equivalent message: "invalid column name". Is that possible?
try
{
..
}
catch (SqlException ex)
{
int a = ex.Number;
ClientScript.RegisterStartupScript(this.GetType(), "", "alert('Errornumber:' + '" + a + "');", true);
}
Thanks

Rijwan AnsariRank #82 · 24.2K reputationPosted Nov 28, 2021, 1:18 AM EST
Kirtesh ShahRank #250 · 10K reputationPosted Nov 27, 2021, 12:23 PM EST
Valerie MeunierRank #1,527 · 1K reputationPosted Nov 27, 2021, 12:52 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Nov 27, 2021, 11:44 PM EST