Novo Layout

Boas a todos os seguidores e visitantes deste blog :)

Após algum tempo sem actualizações, um novo layout para refrescar a imagem do blog:D

Postem o que acham do novo layout e sobre o que gostariam de ver aqui!

abraços

Adding files and folder recursively with Visual SourceSafe 2005

In VSS 2005 when you now choose to add files, you can only add single files and don´t appear an option to folders or recursive
But with this Tip it's possible :)

When you hold shift and then click the button on the toolbar for adding files, you will get the 'old' dialog(previous version), and so be able to check in complete directory structures and files into Visual SourceSafe 2005 but if you want to add all sctruct click in Recursive checkbox

:)

Another options is to Drag'N Drop the folder to a project

Cheers

Mensagens de erro quando tenta instalar componentes do IIS no Windows XP

Após algum (bastante) tempo sem inserir um novo post cá vai mais uma dica :)

Quando tentamos instalar o IIS no Windows XP e nos aparece a seguinte mensagem:

O programa de configuração não consegue copiar o staxmem.dl_ ficheiro. Certifique-se de que o disco chamado ' Windows XP Professional Service Pack 2 CD DOS está na unidade seleccionada abaixo ou forneça a localização onde o ficheiro pode ser encontrado. "Mesmo que o arquivo solicitado seja na localização é especificar.

Isto acontece, provalemente, devido ao ficheiro secedit.sdb poder estar danificado.
Para reparar siga estes passo:
1.Efectue uma cópia do ficheiro Secedit.sdb que se encontra em %windir%\security\database\
2. Abra uma linha de comandos, Executare,, clicando em Iniciar seguida e escrevendo " CMD " e premindo ENTER.
3. Escreva ou copie e cole o seguinte comando
esentutl /p %windir%\security\Database\secedit.sdbe prima ENTER.
Clique em " OK " quando apresentado aviso " reparar ". Aguarde até que de reparação para ser concluída.
4.Neste momento já pode tentar instalar o IIS
:)
Espero que seja útil :)
Até a próxima

Erro Instalar Microsoft SQL Server 2008 Express Edition

Erro no Setup Support Rules:
Rule Name
PerfMonCounterNotCorruptedCheck
Rule Description
Checks if existing
performance counter registry hive is consistent.
Message/Corrective Action
The performance counter registry hive is corrupted. To continue, you must
repair the performance counter registry hive. For more information, see
http://www.speedyshare.com/902763795.html.


É provavél que já tenham tentado instalar o SQL Server 2008 Express Edition e caso não tenham o windows instalado em inglês ter surgido o erro acima descrito.
Comigo aconteceu :) andei a pesquisar e achei a solução.
Para facilitar a vida, criei uma pequena aplicação que resolve esse erro.
Segue aqui o link:

http://www.speedyshare.com/902763795.html

Ao efectuar o download grave no pc, se executar directamente o programa não funcionará correctamente pois fica na pasta dos temporários e não tem permissões para executar.


Para os mais desconfiados e que querem fazer de modo manual ca fica também o processo para corrigir ( são estes os passos que o programa que criei efectua)


Put this at any Console application:
string.Format("{0,3}",
CultureInfo.InstalledUICulture.Parent.LCID.ToString("X")).Replace(" ", "0");

Watch the result. At mine it was "016".

Then you go to the
registry at this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib

and create another one with the name you got
from the string.Format result.
In my case:
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\016"

and copy the info that is on any other
key in this Perflib to this key you
just created. Run the instalation again.
Done!

Stop windows services

Hi after a few time without updating my blog, here is another post :)

This time i will talk about stop an windows service in c# if you don't know the name of the service but you know the name of the process, this is just an one to do, maybe another ways are better..

the code:

private bool servicoLog(string action)
{

ManagementObjectCollection services = null;
//connect to remote machine like :
ConnectionOptions co = new ConnectionOptions();
System.Management.ManagementScope scope = new System.Management.ManagementScope("\\\\" + "localhost" + "\\root\\cimv2", co);
// connect using different credential co.userName = ; co.passsword = ;
System.Management.ObjectQuery getService =
new System.Management.ObjectQuery("Select * from Win32_Process where Name='ServiceName.exe'");

ManagementObjectSearcher search = new ManagementObjectSearcher(scope, getService);
services = search.Get();
string path = null;
//u can navigate throught the servies and play around with it
if (services.Count != 0)
{
foreach (System.Management.ManagementObject obj in services)
{
//this return de executablePath from the exe of the process
path = obj["ExecutablePath"].ToString();

}
//if you want to stop: action =" - stop";
instalation(path, action);

}

return true;

}
private void instalation(string filename)
{
instalation(filename, null);
}

private void instalacoes(string filename, string arguments)
{
Process myprocess = new Process();
myprocess.StartInfo.FileName = filename;
if (argumentos != null)
myprocess.StartInfo.Arguments = arguments;
myprocess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
myprocess.Start(); // Start the process
myprocess.WaitForExit();// ' Wait for it to exit. handy if you will call this sub repeatedly
}

That it's :)

Estudo de Mercado

Utilitário SQL Server Dumper

Primeiro gostaria de pedir desculpas pela falta de actualização do blog...

Indo ao que interessa:)


Não seria bom poder gerar um script de insert com dados de uma tabela do SQL Server?

Para mim seria e foi muito bom ter encontrado este pequeno mas muito útil aplicativo.

Chama-se SQL Server Dumper.

Este aplicativo permite, exportar (e gerar os scripts para inserção) de várias tabelas em vários ou num único

ficheiro .sql :)

Mas para mim o mais útil é permitir exportar os dados de uma determinda query, e não ser a tabela por inteiro como outros aplicativos:)

Se quiserem experimentar( é freeware :):) ) é só clicar aqui.