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"];
}
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"];
}