MessageBox oddity

  • Thread starter Thread starter Earl
  • Start date Start date
E

Earl

Relatively new to C# and I have an odd situation. When I show a messagebox
when catching an exception, the message shows briefly then disappears.

private void PopulateBrands()
{
SqlConnection strSQLServer = new SqlConnection(strConn);
SqlCommand cmd = new SqlCommand("sel_BrandsEST", strSQLServer);
cmd.CommandType = CommandType.StoredProcedure;
if (ds.Tables.Contains("dtBrands"))
{
ds.Tables["dtBrands"].Clear();
}
try
{
strSQLServer.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
da.Fill(ds, "dtBrands");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
dtBrands = ds.Tables["dtBrands"];

}
 
Earl said:
Relatively new to C# and I have an odd situation. When I show a messagebox
when catching an exception, the message shows briefly then disappears.

In the debugger or in the release version? All sorts of strange things can
get intercepted by the debugger.
 
Back
Top