Using Windows Authentication with IIS and the Database on the Same Machine

Se in web.config non è impostato: <identity impersonate="true" /> ASP.NET gira sotto l'account ASPNET (sia con: Anonymous Access che con No Anonymous Access (Basic, Integrated etc)).

 

CREARE UTENTE ASPNET IN SQL Server

SQL Server Management Studio:

-> Protezione -> Account di Accesso -> Nuovo Account di Accesso:

Login Name:MACHINENAME\ASPNET
Autenticazione Windows
Database predefinito: master

-> Database -> Selezionare database interessato -> Protezione -> Utenti -> Nuovo Utente

(pagina: Generale)
User name: ASPNET
Login di accesso:MACHINENAME\ASPNET

Appartenenza a ruoli del database:
- db_datareader
- db_datawriter

(pagina: Entità e protezione diretta (se ci sono per esempio delle stored da abilitare))

Aggiungere le stored necessarie e abilitare il per messo di 'Execute'

 

In Visual Studio

La stringa (o le stringhe di connessione) devono essere:

connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=CATALOG_NAME;Integrated Security=True;Connect Timeout=30"
providerName="System.Data.SqlClient" />



ERROR:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection.

Go to:

SQL Server Enterprise Manager -> Tools -> SQL Server Configuration Properties -> Security

and set: Authentication: SQL Server and Windows



IMPOSSIBILE ACCEDERE COME UTENTE 'sa' CON L'AUTENTICAZIONE SQL Server

When installing Visual Studio 2005 or Visual Studio 2008, the installer will automatically install for us one instance of SQL Server 2005 Express. But we can't actually connect the database without extra tools and we can't login except using Integrated Security. In this article I will explain how to download extra tools and how to login using sa account (not Windows Authentication Mode).

1. First download Management Studio Express for SQL Server Express 2005, this tool will enable you to connect with SQLExpress instance that is installed via Visual Studio. Install this tool and you can connect to database
[MyComputerName]\SQLEXPRESS but for first you will need to use Windows Authentication mode. This way you can connect to the instance.

2. After success connecting the database, Open Security tree, Logins tree and you can see sa account. Double click 'sa' account and from General page, change the Password and Confirm Password to new password that you want. Then change to Status page, on Login section select Enabled. Then click OK.

3. Now right click the [MyComputerName]/SQLExpress and select Properties then open the Security page, on Server Authentication section select SQL Server and Windows Authentication Mode.

4. Open Services diaog box, (on Control Panel open Administrative Tools, then Services). Select the SQL Server (SQLEXPRESS) service, restart this service.

5. Now you can connect to SQLEXPRESS instance using Management Studio via sa account and new password you set.

NOTA: la password DEVE essere impostata



Pagine ASP non possono riconoscere i file aggiornati ASP di script pagine ASP non li possono restituire quando si installa Internet Information Server (IIS) e si esegue su Microsoft Cluster Server

1. Fare clic sul pulsante Start, scegliere Esegui, digitare il regedit e quindi scegliere OK.
2. Trovare e quindi scegliere la seguente sottochiave di Registro di sistema:
HEKY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters
3. Fare clic con il pulsante destro di Parametri, scegliere Nuovo e quindi scegliere Valore DWORD.
4. Nella casella Nuovo valore # 1, digitare DisableMemoryCache e quindi premere INVIO.
5. Fare clic con il pulsante destro di DisableMemoryCache e quindi scegliere Modifica.
6. Nella casella Dati valore, digitare 1 e quindi scegliere OK.
7. Chiudere l'editor del Registro di sistema e quindi riavviare il computer.



A database with the same name exists, or specified file cannot be opened, or it is located on UNC share

Right click the App_Data folder in Windows Explorer, go to the Security tab, click the "Advanced" button, click "Change permissions", select the option to propagate changes to children objects and click "Apply"