Пример #1
0
        public DBGoodTypeTest()
        {
            connstr = DatabaseSetup.GetConnectionStringsConfig("MyCon");
            SqlConnection connsql = new SqlConnection(connstr);
            StreamWriter  SW      = new StreamWriter("C:\\TEST.TXT");

            try
            {
                SW.WriteLine("DBGoodTypeTest" + connstr);
                SW.Flush();
                connsql.Open();
                bolconn = true;
                SW.WriteLine(bolconn);
                SW.Flush();
                SW.Close();
            }
            catch (Exception error)
            {
                SW.WriteLine(error.Message);
                SW.Flush();
                SW.Close();
                bolconn = false;
                if (connsql != null)
                {
                    connsql.Dispose();
                }
            }
            finally
            {
                connsql.Close();
                if (connsql != null)
                {
                    connsql.Dispose();
                }
            }
        }