Esempio n. 1
0
        public bool Invalid()
        {
            bool result = false;

            SqlCmd.Error += (sender, e) =>
            {
                result = true;
            };

            try
            {
                SqlCmd.ExecuteScalar();

                return(result);
            }
            catch (Exception)
            {
                return(true);
            }
        }
Esempio n. 2
0
        public static object ExecuteScalar(this ConnectionProvider provider, string script)
        {
            SqlCmd cmd = new SqlCmd(provider, script);

            return(cmd.ExecuteScalar());
        }