lunes, 4 de diciembre de 2023

cannot connect to wmi provider. you do not have permission or the server is unreachable

abrir cmd como administrador.


Ejecutar :

cd  C:\Program Files (x86)\Microsoft SQL Server\150\Shared


(o version que tengan instalada )


Y ejecutar  mofcomp sqlmgmproviderxpsp2up.mof




jueves, 20 de agosto de 2020

npm ERR! Maximum call stack size exceeded

 Para solucionar esto hay muchas formas comentadas en la web

Pero a mi me funciona con lo siguiente:

ejecutar:

npm update

martes, 11 de febrero de 2020

Error al ejecutar el generador de codigos seleccionado: Referencia a objeto no establecida como instancia de un objeto

Este error me aparecia cada vez que queria agregar un controlador al proyecto de visual studio 2017.

La solucion fue la siguiente:

Cerrar el visual studio
Abrir el visual studio.



miércoles, 30 de octubre de 2019

Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a "web.config" configuration file located in the root directory of the current web application. This tag should then have its "mode" attribute set to "Off".

Para solucionar esto en asp.net mvc,

Tuve que realizar la siguiente modificacion:


Este codigo originalmente estaba asi:

app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login"),
                Provider = new CookieAuthenticationProvider
                {
                    // Enables the application to validate the security stamp when the user logs in.
                    // This is a security feature which is used when you change a password or add an external login to your account. 
                    OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
                        validateInterval: TimeSpan.FromMinutes(30),
                        regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
                }
            });



Y luego, comente  lo de OnValidateIdentity quedando asi:



 app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath = new PathString("/Account/Login"),
                Provider = new CookieAuthenticationProvider
                {
                    // Enables the application to validate the security stamp when the user logs in.
                    // This is a security feature which is used when you change a password or add an external login to your account. 
                    //OnValidateIdentity = SecurityStampValidator.OnValidateIdentity<ApplicationUserManager, ApplicationUser>(
                    //    validateInterval: TimeSpan.FromMinutes(30),
                    //    regenerateIdentity: (manager, user) => user.GenerateUserIdentityAsync(manager))
                }
            });

jueves, 15 de agosto de 2019

Obtener el dia de la semana SQL Server

El siguiente script devuelve el numero del dia de la semana

SELECT DATEPART(WEEKDAY, GETDATE())

Obtener el numero de semana del mes SQL server

Para obtener el numero de semana del mes en sql se puede usar el siguiente ejemplo:


DECLARE @DATE DATETIME
SET @DATE = '2019-06-01'

SELECT DATEPART(WEEK, @DATE)  -
    DATEPART(WEEK, DATEADD(MM, DATEDIFF(MM,0,@DATE), 0))+ 1 AS WEEK_OF_MONTH




Si se tiene en cuenta que el corte de semana  es luego del primer domingo:



declare @date datetime = '2019-06-03'
select datediff(week, dateadd(week, datediff(week, 0, dateadd(month, datediff(month, 0, @date), 0)), 0), @date - 1) + 1;

miércoles, 10 de abril de 2019

An error occurred while starting the application. .NET Core 4.6.27521.02 X64 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.2.0-rtm-35687 | Microsoft Windows 10.0.17134

Para encontrar el posible error modifique el archivo de configuracion we.config

Cambiando el parametro stdoutLogEnabled=true

Y luego crea una carpeta logs en el directorio donde se encuntra la aplicacion. En el mismo se puede observar el problema que esta teniendo

HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. Detailed Error Information: Module IIS Web Core

En el web.config hay que cambiar processPath  y reemplazar por donde esta fisicamente dotnet.exe




<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\your-project.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout"/>
  </system.webServer>
</configuration>

martes, 26 de febrero de 2019

Configuracion formato fecha sql server

Para configurar el formato de la fecha en sql server se puede hacer  para el usuario de sesion:

ALTER LOGIN sa WITH DEFAULT_LANGUAGE=English


o por transaccion:

 SET DATEFORMAT ymd;



----
Para saber la configuracion actual se puede usar la siguiente consulta:


SELECT      type_desc,
    default_database_name,
    default_language_name
FROM master.sys.server_principals
WHERE name = 'sa';

lunes, 13 de agosto de 2018

Abrir SQL Server Configuration Manager

Cuando en windows no encontramos el acceso directo  SQL Server Configuration Manager, podemos ejecutarlo de la siguiente manera:

Ir a ejecutar y escribir  según el caso que corresponda:




SQL Server 2017                                      =>     SQLServerManager14.msc

SQL Server 2016                                      =>     SQLServerManager13.msc

SQL Server 2014 (12.x)                            =>     SQLServerManager12.msc

SQL Server 2012 (11.x)                           =>     SQLServerManager11.msc

jueves, 28 de diciembre de 2017

you have an incorrect version of driver 'vmci.sys'

Ir a:
C:\users\yourusername\Documents\Virtual Machines

Luego en la VM que nos presenta el error, buscamos el archivo .vmx

Finalmente lo abrimos con un editor de texto y cambiamos lo siguiente:

vmci0.present = "TRUE"

por

vmci0.present = "FALSE"

martes, 29 de agosto de 2017

Visual Studio crashes when trying to add a DataSet to an rdlc Report

Para solucionar este bug hay que hacer lo siguiente:


  1. Ir a ejecutar.
  2. escribir cmd y ejecutarlo como administrador.
  3. C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>devenv.exe /ResetUserData

martes, 1 de agosto de 2017

Report Viewer Configuration Error -The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file. Add




Hay que agregar   3 etiquetas:

1)
 <compilation debug="true" targetFramework="4.5.2">
      <buildProviders>
        <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider"/>

      </buildProviders>


2)    
      <assemblies>
        <add assembly="Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
        <add assembly="Microsoft.ReportViewer.Common, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
        <add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
      </assemblies>



3)

  <system.webServer>
    <handlers>
      <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
    </handlers>

...

The Report Viewer Web Control requires a System.Web.UI.ScriptManager on the web form

Agregar en la Web Form la siguiente etiqueta:

 <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

miércoles, 21 de diciembre de 2016

CS0234: El tipo o el nombre del espacio de nombres 'Html' no existe en el espacio de nombres 'System.Web.Mvc'

Para solucionar esto, hay que ir al Explorador de Soluciones-> References

Luego clic con el boton derecho y seleccionar propiedades.

Luego En la propiedad de Copia Local= True


viernes, 28 de octubre de 2016

Código de las culturas

Algo muy útil que siempre nos hace falta y perdemos tiempo en buscarlo.


.
afAfrikaanssqAlbanian
ar-saArabic (Saudi Arabia)ar-iqArabic (Iraq)
ar-egArabic (Egypt)ar-lyArabic (Libya)
ar-dzArabic (Algeria)ar-maArabic (Morocco)
ar-tnArabic (Tunisia)ar-omArabic (Oman)
ar-yeArabic (Yemen)ar-syArabic (Syria)
ar-joArabic (Jordan)ar-lbArabic (Lebanon)
ar-kwArabic (Kuwait)ar-aeArabic (U.A.E.)
ar-bhArabic (Bahrain)ar-qaArabic (Qatar)
euBasque (Basque)bgBulgarian
beBelarusiancaCatalan
zh-twChinese (Taiwan)zh-cnChinese (PRC)
zh-hkChinese (Hong Kong SAR)zh-sgChinese (Singapore)
hrCroatiancsCzech
daDanishnlDutch (Standard)
nl-beDutch (Belgium)enEnglish
en-usEnglish (United States)en-gbEnglish (United Kingdom)
en-auEnglish (Australia)en-caEnglish (Canada)
en-nzEnglish (New Zealand)en-ieEnglish (Ireland)
en-zaEnglish (South Africa)en-jmEnglish (Jamaica)
enEnglish (Caribbean)en-bzEnglish (Belize)
en-ttEnglish (Trinidad)etEstonian
foFaeroesefaFarsi
fiFinnishfrFrench (Standard)
fr-beFrench (Belgium)fr-caFrench (Canada)
fr-chFrench (Switzerland)fr-luFrench (Luxembourg)
gdGaelic (Scotland)gaIrish
deGerman (Standard)de-chGerman (Switzerland)
de-atGerman (Austria)de-luGerman (Luxembourg)
de-liGerman (Liechtenstein)elGreek
heHebrewhiHindi
huHungarianisIcelandic
idIndonesianitItalian (Standard)
it-chItalian (Switzerland)jaJapanese
koKoreankoKorean (Johab)
lvLatvianltLithuanian
mkMacedonian (FYROM)msMalaysian
mtMaltesenoNorwegian (Bokmal)
noNorwegian (Nynorsk)plPolish
pt-brPortuguese (Brazil)ptPortuguese (Portugal)
rmRhaeto-RomanicroRomanian
ro-moRomanian (Republic of Moldova)ruRussian
ru-moRussian (Republic of Moldova)szSami (Lappish)
srSerbian (Cyrillic)srSerbian (Latin)
skSlovakslSlovenian
sbSorbianesSpanish (Spain)
es-mxSpanish (Mexico)es-gtSpanish (Guatemala)
es-crSpanish (Costa Rica)es-paSpanish (Panama)
es-doSpanish (Dominican Republic)es-veSpanish (Venezuela)
es-coSpanish (Colombia)es-peSpanish (Peru)
es-arSpanish (Argentina)es-ecSpanish (Ecuador)
es-clSpanish (Chile)es-uySpanish (Uruguay)
es-pySpanish (Paraguay)es-boSpanish (Bolivia)
es-svSpanish (El Salvador)es-hnSpanish (Honduras)
es-niSpanish (Nicaragua)es-prSpanish (Puerto Rico)
sxSutusvSwedish
sv-fiSwedish (Finland)thThai
tsTsongatnTswana
trTurkishukUkrainian
urUrduveVenda
viVietnamesexhXhosa
jiYiddishzuZulu


Fuente:
https://msdn.microsoft.com/en-us/library/ms533052(v=vs.85).aspx

viernes, 16 de septiembre de 2016

no se puede iniciar el servidor web de iis express desde visual studio

Para solucionar esto debemos ir al archivo .csproj  (C#) o .vbproj (Visual Basic). y abrirlo con un editor de texto.
Luego vamos a las siguientes lineas y comentamos tal cual aparece lo que esta en negrita:

  <ProjectExtensions>
    <VisualStudio>
      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
        <WebProjectProperties>
          <UseIIS>False</UseIIS>
          <AutoAssignPort>True</AutoAssignPort>
          <DevelopmentServerPort>65408</DevelopmentServerPort>
          <DevelopmentServerVPath>/</DevelopmentServerVPath>

         <!--  <IISUrl>http://localhost/NOMBRE</IISUrl>
          <OverrideIISAppRootUrl>True</OverrideIISAppRootUrl> 
          <IISAppRootUrl>http://localhost/NOMBRE</IISAppRootUrl>-->

          <NTLMAuthentication>False</NTLMAuthentication>
          <UseCustomServer>False</UseCustomServer>
          <CustomServerUrl>
          </CustomServerUrl>
          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
        </WebProjectProperties>
      </FlavorProperties>
    </VisualStudio>
  </ProjectExtensions>

lunes, 29 de agosto de 2016

Eliminar Registros duplicados en sql oracle

Borrar registros duplicados según ID:
DELETE FROM NombreTabla
WHERE ID not in (
                                  SELECT MIN(ID)
                                  FROM NombreTabla
                                  GROUP BY NombreColumna1, NombreColumna2
                               );

Borrar registros duplicados SIN ID:
DELETE FROM NombreTabla
WHERE rowid not in (
                     SELECT MIN(rowid)
                     FROM NombreTabla
                     GROUP BY NombreColumna1, NombreColumna2
                    );