Beispiel #1
0
        }// End of setConnectionString pro

        public static Boolean IsCheckConnect(string _ServerName, string _Databasename, string _LoginName, string _LoginPassword)
        {
            try
            {
                string     ConnectionString = "Data Source=" + _ServerName + ";Initial Catalog=" + _Databasename + ";User ID=" + _LoginName + "; Password="******";Connect Timeout=100";
                CSQLServer sqlServer        = new CSQLServer(ConnectionString);
                string     sql   = "sp_GetInfoCongTy";
                DataTable  table = sqlServer.readData(sql);
                if (table != null && table.Rows.Count > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }