I have a .aspx page calling a .asmx page's web service. In that .net web service I attempt to open a database connection to SQLServer 2008. The connection is failing. I am not sure why. I am doing this in a try / catch and the catch does get hit when I debug. I'm not sure what I can output there though as I don't have access to the server's filesystem to write a log file.
I found this posting:
try
{
SqlCommand cmd =
new SqlCommand("raiserror('Manual SQL exception', 16, 1)",DBConn);
cmd.ExecuteNonQuery();
}
catch (SqlException ex)
{
string msg = ex.Message; // msg = "Manual SQL exception"
}
here and it might do the trick for me, but I don't know how to make the msg string output to the page which called this web service? Is there a way to propagate it up the exception chain by having the calling page also implement that same exception handler?
Thanks // :)