17 March 2015

Receita de Bolo Formigueiro

Vale a pena fazer em casa. Segue o link pessoal.
http://tudogostoso.me/r77084.html

10 October 2011

Know how many records there is inside a table using Sql without using COUNT

SELECT T.OWNER
      ,T.TABLE_NAME
      ,T.NUM_ROWS
  FROM ALL_TABLES T
 WHERE T.OWNER = 'RHOWN'
   AND T.TABLE_NAME IN ('FUNCIONARIO_MOVIMENTOS_HIST')

5 October 2011

Adding read permission for groups and users with files

If you wanna put some permissions for groups or users who doesn’t need to access certain files, you can use the class FileSystemAccessRule.

 

Let see the example:

 

using System;

using System.IO;

using System.Security.AccessControl;

 

namespace FileSystemExample

{

    class FileExample

    {

        public static void Main()

        {

            try

            {

                string fileName = "test.xml";

 

                Console.WriteLine("Adding access control entry for "

                    + fileName);

 

                // Add the access control entry to the file.

                AddFileSecurity(fileName, @"DomainName\AccountName",

                    FileSystemRights.ReadData, AccessControlType.Allow);

 

                Console.WriteLine("Removing access control entry from "

                    + fileName);

 

                // Remove the access control entry from the file.

                RemoveFileSecurity(fileName, @"DomainName\AccountName",

                    FileSystemRights.ReadData, AccessControlType.Allow);

 

                Console.WriteLine("Done.");

            }

            catch (Exception e)

            {

                Console.WriteLine(e);

            }

        }

 

        // Adds an ACL entry on the specified file for the specified account.

        public static void AddFileSecurity(string fileName, string account,

            FileSystemRights rights, AccessControlType controlType)

        {

 

 

            // Get a FileSecurity object that represents the

            // current security settings.

            FileSecurity fSecurity = File.GetAccessControl(fileName);

 

            // Add the FileSystemAccessRule to the security settings.

            fSecurity.AddAccessRule(new FileSystemAccessRule(account,

                rights, controlType));

 

            // Set the new access settings.

            File.SetAccessControl(fileName, fSecurity);

 

        }

 

        // Removes an ACL entry on the specified file for the specified account.

        public static void RemoveFileSecurity(string fileName, string account,

            FileSystemRights rights, AccessControlType controlType)

        {

 

            // Get a FileSecurity object that represents the

            // current security settings.

            FileSecurity fSecurity = File.GetAccessControl(fileName);

 

            // Remove the FileSystemAccessRule from the security settings.

            fSecurity.RemoveAccessRule(new FileSystemAccessRule(account,

                rights, controlType));

 

            // Set the new access settings.

            File.SetAccessControl(fileName, fSecurity);

 

        }

    }

}

 

Link: http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.filesystemaccessrule.aspx

 

18 July 2009

Sql for list all objects from Sql Server 2005 by re

I had been search on internet how can I list all object in sql server by sql commands. I found its sql as shown below :

SELECT name, CASE xtype WHEN 'C' THEN 'CHECK constraint' WHEN 'D' THEN 'Default or DEFAULT constraint' WHEN 'F' THEN 'FOREIGN KEY constraint ' WHEN 'L' THEN 'Log '
WHEN 'P' THEN 'Stored procedure '
WHEN 'PK' THEN 'PRIMARY KEY constraint (type is K) '
WHEN 'RF' THEN 'Replication filter stored procedure '
WHEN 'S' THEN 'System tables '
WHEN 'TR' THEN 'Triggers '
WHEN 'U' THEN 'User table '
WHEN 'UQ' THEN 'UNIQUE constraint (type is K) '
WHEN 'V' THEN 'Views '
WHEN 'X' THEN 'Extended stored procedure '
WHEN 'TF' THEN 'Functions'
END AS type
FROM dbo.sysobjects
ORDER BY type ASC


> List all database in your
SELECT * FROM sys.databases

> List all tables from specific database put it on before the tag 'sys.tables'
SELECT * FROM sys.tables
SELECT * FROM northwind.sys.tables
SELECT * FROM master.sys.tables

28 June 2009

Creating application Domains

Dominio de aplicacao e um container aonde permitem multiplos assembles rodando dentro de um unico processo previnindo assim um acesso direto ao assemble corrente. Exemplo de aplicacoes de dominio sao quando se acessa os processos do IIS 5 implementados em aspnet_wp.exe. Se 10 pessoas acessarem um web site simultaneamente, o asp.net criara separadamente aplicacoes de dominio para cada um usuario. Baixar exemplo de como gerar uma aplicacao de dominio.