1 0 Archive | Code RSS feed for this section
post icon

The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

Nella programmazione SOA oriented, uno dei principali errori che si commette nell’utilizzo dei servizi WCF e creare un’istanza del Transparent Proxy all’interno dello statement using, come segue: using(ServiceReference.ClientType client = new ServiceReference.ClientType(“EndpointAddress”))   {       //faccio qualcosa   } // <– Questa linea potrebbe generare un errore L’errore che si riceve è il seguente: Type: [...]

More »
30 nov, 2011
post icon

T-SQL rename Table Sql Server

Quando si effettuano modifiche alla struttura di un database Sql Server con Microsoft SQL Server Management Studio è possibile ottenere facilmente lo script mediante la funzione Generate Change Script. Questo non accade quando si rinomina un oggetto del database, ad esempio quando si rinomina una tabella (F2) o una Stored Procedure, ma anche una quandi [...]

More »
post icon

The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138)

Se provi ad eliminare un utente che appartiene a uno schema, riceverai l’errore seguente: Drop failed for User ‘my_user’.  (Microsoft.SqlServer.Smo) The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error: 15138) dunque, per eliminare l’utente, bisogna trovare lo schema a cui appartiene, e trasferire l’ownership ad un altro [...]

More »
01 set, 2011
post icon

Sharepoint 2010 List Event Receiver SPContext.Current is null

Quando si sviluppa un Event Receiver su una generica lista Sharepoint non è possibile ottenere l’istanza di SPWeb dal contesto corrente mediante l’istruzione seguente: poichè viene eseguito in un contesto differente, e dunque SPContext.Current = null. Per ovviare a questo problema è sufficiente far riferimento al parametro SPItemEventProperties ricevuto, e quindi ottenendo un’istanza di SPWeb [...]

More »
post icon

Team Foundation Server Force Undo CheckOut file of a different user

Qualora aveste l’esigenza di fare un Undo forzato di un file in checkout da un altro utente potete utilizzare il seguente comando da prompt di Visual Studio: tf undo /workspace:WORKSPACE;username $/MyTFSProject/MyFile.cs /s:http://tfsURL:8081 dove WORKSPACE;username lo trovate facendo tasto destro sul file -> Proprietà -> tab Status $/MyTFSProject/MyFile.cs è il path del file di cui fare [...]

More »
01 giu, 2011