Quando eu tentei fazer o restore usando o wizard do sql server eu recebi uma mensagem de erro.
Para resolver este problema eu abri uma New Query, mudei para o bando de dados diferente do que eu desejava fazer o restore e executei o seguinte comando:
RESTORE DATABASE MyDatabase FROM DISK='d:\arquivo.bak' with replace
Pronto! Banco restaurado! Muito Obrigado e até o próximo POST!
sexta-feira, 17 de janeiro de 2014
sexta-feira, 3 de janeiro de 2014
JQuery - Como pegar o item selecionado do auto complete
Fazer o auto complete com jquery é relativamente simples, agora pegar o item selecionado é mais simples ainda. Segue o código:
$("#NomeAtivo").autocomplete({
source: function (request, response) {
$.ajax({
url: '@Url.Action("GetAtivo", "Ordem")',
dataType: "json",
data: {
term: request.term,
idTipoAtivo: $("#TipoAtivo").val()
},
success: function (data) {
response(data);
}
});
},
min_length: 3,
delay: 300,
select: function (a, b) {
if ($("#TipoAtivo").val() == 5) {
$.ajax({
url: '@Url.Action("CarregaPrecoExercicio", "Ordem")',
dataType: "json",
type: "POST",
data: {
codigoAtivo: b.item.value
},
success: function (data) {
$("#PrecoExercicio").val(data);
}
});
}
}
});
Muito Obrigado e até o próximo POST!
$("#NomeAtivo").autocomplete({
source: function (request, response) {
$.ajax({
url: '@Url.Action("GetAtivo", "Ordem")',
dataType: "json",
data: {
term: request.term,
idTipoAtivo: $("#TipoAtivo").val()
},
success: function (data) {
response(data);
}
});
},
min_length: 3,
delay: 300,
select: function (a, b) {
if ($("#TipoAtivo").val() == 5) {
$.ajax({
url: '@Url.Action("CarregaPrecoExercicio", "Ordem")',
dataType: "json",
type: "POST",
data: {
codigoAtivo: b.item.value
},
success: function (data) {
$("#PrecoExercicio").val(data);
}
});
}
}
});
Muito Obrigado e até o próximo POST!
quinta-feira, 2 de janeiro de 2014
Como saber se um acoluna já existe em uma tabela no SQL Server
Extsre duas formas de verificar se uma coluna já existe em uma tabela:
1 - Procedure do Sistema:
sp_columns @table_name = ´TABELATESTE´, @column_name = ´CAMPOTESTE´
2 - Select simples:
IF ((select count(name) from syscolumns where id=object_id(N'[dbo].[OrdemGrupo]') and name='ValorMedio') > 0)
BEGIN
ALTER TABLE OrdemGrupo
DROP COLUMN ValorMedio
END
Fonte: http://www.devmedia.com.br/forum/saber-se-uma-coluna-existe-na-tabela/34378
1 - Procedure do Sistema:
sp_columns @table_name = ´TABELATESTE´, @column_name = ´CAMPOTESTE´
2 - Select simples:
IF ((select count(name) from syscolumns where id=object_id(N'[dbo].[OrdemGrupo]') and name='ValorMedio') > 0)
BEGIN
ALTER TABLE OrdemGrupo
DROP COLUMN ValorMedio
END
Fonte: http://www.devmedia.com.br/forum/saber-se-uma-coluna-existe-na-tabela/34378
Javascript - Converter número para o formato moeda (Real)
Number.prototype.formatMoney = function(c, d, t){
var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0; return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); }; // usando (1000).formatMoney(2, ',', '.'); //retorna 1.000,00
quarta-feira, 1 de janeiro de 2014
W-Fi de graça
Quantas vezes você já não precisou acessar a internet na rua e ficou sem saber onde ou como.
E para completar encontra várias redes de Wi-Fi bloqueadas com senha. Na minha opinião todos deveriam deixar suas redes liberadas para que qualquer um pudesse acessar.
Enfim, segue o link que um aplicativos muito interessante para descobrir senhas de lugares públicos:
http://www.techtudo.com.br/tudo-sobre/s/mandic-magic.html
Fonte: http://www.techtudo.com.br/noticias/noticia/2013/12/saiba-onde-achar-wi-fi-gratis-em-sao-paulo-e-no-rio-de-janeiro.html
E para completar encontra várias redes de Wi-Fi bloqueadas com senha. Na minha opinião todos deveriam deixar suas redes liberadas para que qualquer um pudesse acessar.
Enfim, segue o link que um aplicativos muito interessante para descobrir senhas de lugares públicos:
http://www.techtudo.com.br/tudo-sobre/s/mandic-magic.html
Fonte: http://www.techtudo.com.br/noticias/noticia/2013/12/saiba-onde-achar-wi-fi-gratis-em-sao-paulo-e-no-rio-de-janeiro.html
Gerenciador de Arquivos gratuito e sem limite de armazenamento
No primeiro POST do ano quero lhes apresentar o MINHATECA, que permite que o usuário armazene arquivos sem limite e na nuvem. Grande dica para quem tem que criar varias contas no Dropbox para conseguir armazenar seus arquivos todos.
Segue o link e aproveite: http://www.techtudo.com.br/tudo-sobre/s/minhateca.html
Muito Obrigado e até o próximo POST!
Segue o link e aproveite: http://www.techtudo.com.br/tudo-sobre/s/minhateca.html
Muito Obrigado e até o próximo POST!
sexta-feira, 27 de dezembro de 2013
Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http]
Link to get the project example: click here
I was having a problem to configure a WCF with wsHttpBinding, and after a big research I found a solution. Here the web.config:
I was having a problem to configure a WCF with wsHttpBinding, and after a big research I found a solution. Here the web.config:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<services>
<service name="WCFServiceAuthentication.ServiceAuthentication" behaviorConfiguration="ServiceBehavior">
<!-- Service Endpoints -->
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="TransportSecurity" contract="WCFServiceAuthentication.IServiceAuthentication">
<!--<identity>
<dns value="localhost" />
</identity>-->
</endpoint>
</service>
</services>
<bindings>
<wsHttpBinding>
<binding name="TransportSecurity">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Basic" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpsGetEnabled="true" httpsGetUrl="" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="false"/>
</system.webServer>
</configuration>
Just paste this code into your web.config that gonna work.
Thank you and see you on the next POST.
Credits: MSDN Forum
Assinar:
Comentários (Atom)

