예제 #1
0
        public static SqlDataReader executeQuery(string query)
        {
            SqlDataReader result = null;

            try
            {
                SqlCommand com = new SqlCommand(query, DatabaseConection.getInstance());
                com.CommandText = query;
                result          = com.ExecuteReader();
            }
            catch (SqlException e) {
                if (result != null & !result.IsClosed)
                {
                    result.Close();
                }
                throw e;
            }
            return(result);
        }
예제 #2
0
 public static SqlDataReader executeQuery(SqlCommand command)
 {
     command.Connection = DatabaseConection.getInstance();
     return(command.ExecuteReader());
 }