How do I retreive warnings?

  • Thread starter Thread starter Peter Strøiman
  • Start date Start date
P

Peter Strøiman

If I do something like this:

SqlConnection connection = new SqlConnection( ... )
SqlCommand command = new SqlCommand( ... )
// initialize command object.
command.ExecuteNonQuery();

How do I determine if the sql server generated a warning, and how do I
"read" the warning?

Thanks in advance,
Peter Strøiman
 
Use try/catch/finally block and
read the exception .Message property in
the catch section

try
{

}
catch (Exception e) { Debug.WriteLine(e.Message); }
finally { }
 
Back
Top