lunes, 21 de mayo de 2018

CredSSP Encryption oracle remediation error caused by May 2018 Update



Open a cmd prompt as administrator and run this command


 reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /f /v AllowEncryptionOracle /t REG_DWORD /d 2

then try your remote desktop.


viernes, 26 de enero de 2018

Multiple Parameters WEB API

I had looked for this everywhere until I had found this sample from Mudita Rathore

 http://www.c-sharpcorner.com/UploadFile/2b481f/pass-multiple-parameter-in-url-in-web-api/

while his sample is using MVC Web API it helped me a lot.

Basically I wanted to be able to search for a Person : First, Middle, and DOB

One of the solution was rooting but I wanted to have a simpler alternative.

So here are the steps very simple:

1. Create a WEB API Project using Visual Studio

2. Expand the folder Controllers

Edit the ValuesController.cs

add this GET method.

public string Get(string strFirstName, string strLastName, DateTime dtDOB)
        {
            return strFirstName + " " + strLastName+ " " +dtDOB.ToString() ;
        }


Run the project and go to

http://localhost:PORT/api/values/?strFirstName=Jorge&strLastName=Vera&dtDOB=01/26/2018%2004:00%20PM

Where port is your assigned number port.


and you will get a xml/json return,

The key is your Parameters Name are the same as your GET Parameters

So the good part here is that you can pass parameters to  your WEB API process the request access a database get the result based in the parameters received.

most of the examples I read and watched only talk about a GET method that will take and Index value or return a general list, but in the real world you need to provide several filter for the same query, a date range, a list of parameters like Client Code, Bill Number, Zipcode all of them at once.

I hope this small sample helps and again thanks to
 http://www.c-sharpcorner.com/members/mudita-rathore
for his sample.



martes, 11 de octubre de 2016

80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

We have a website application that uses a 32 bit OCX reference and We were getting the nice error

80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

This was case escenario:
We were developing using  VS 2010 Asp.net  running it as Administrator
Server was Windows 2012 R2 64 bits
We were using an OCX library that works in 32 bit, We installed this Library as Administrator.

Still we were getting the error.

80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Another error We were getting was STDOLE.DLL can not be copied to the Refence folder.


Remember, the Library worked in a 32 bit app.



Go to the  Application Pools from the IIS Manager


Right click in the application Pool , select Advanced Settings.



Enable 32-Bit applications SET IT TO TRUE

Set all the Applications Pool the same way.




Then go to your Web Application, right click on it and select Manage application then Advanced Settings



There Select the Application Pool you will be using for the Web Application you are having problems.


Compile, test, celebrate!

jueves, 25 de agosto de 2016

LinkedIn Background Image

Go to Google Image Search and search for anything you like to be your image background.

then use any capture screen software you like to capture the best combination you like,
I use screenshot captor
https://www.donationcoder.com/Software/Mouser/screenshotcaptor/

and no I am not getting any money for this :) I wish I could

here some examples:

Some Peruvian beaches



Do you like Software Companies?




and this is my current linkedin background



simple and nice. I am not a Graphic Designer so this approach will work for me.

lunes, 8 de agosto de 2016

Tsql Tips

Sometimes you need random numbers from 1 to 1000 and without duplicated numbers, here is the link:

http://sqlperformance.com/2013/09/t-sql-queries/random-collisions

Backup all databases at once from a SQL Server?
https://www.mssqltips.com/sqlservertip/1070/simple-script-to-backup-all-sql-server-databases/

Reindex all tables in a DB TSQL
http://blog.sqlauthority.com/2015/02/15/interview-question-of-the-week-007-how-to-reindex-every-table-of-the-database/


lunes, 25 de enero de 2016

Bulk Insert Notes

How to Fix Error : 
Msg 4866, Level 16, State 7, Line 2
The bulk load failed. The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.
Msg 7399, Level 16, State 1, Line 2
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 2
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".


Part of my format file is like this

10.0
59
1       SQLCHAR             2       20      ""   1     "RecordType"                        SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             2       50      ""   2     "FullName"                           SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             2       9       ""   3     "CompanyID"                         SQL_Latin1_General_CP1_CI_AS


Solution:
So I changed this "             2       " to "             0       "

10.0
59
1       SQLCHAR             0       20      ""   1     "RecordType"                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     "FullName"                           SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     "CompanyID"                          SQL_Latin1_General_CP1_CI_AS

Please notice the differences line per line 



/*****************************************************/
How to Fix Error : 
Msg 4823, Level 16, State 1, Line 3
Cannot bulk load. Invalid column number in the format file "C:\COMPANIES.fmt".

Format File is like this:

10.0
59
1       SQLCHAR             0       20      ""   1     [RecordType]                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     FullName                             SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     [CompanyID]                          SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       3       ""   4     [Column 3]                           SQL_Latin1_General_CP1_CI_AS

Solution:
Changed the Square Brackets for double quotes

10.0
59
1       SQLCHAR             0       20      ""   1     "RecordType"                         SQL_Latin1_General_CP1_CI_AS
2       SQLCHAR             0       50      ""   2     FullName                             SQL_Latin1_General_CP1_CI_AS
3       SQLCHAR             0       9       ""   3     "CompanyID"                          SQL_Latin1_General_CP1_CI_AS
4       SQLCHAR             0       3       ""   4     "Column 3"                           SQL_Latin1_General_CP1_CI_AS


/*****************************************************/
How to Fix Error : 
Msg 4862, Level 16, State 1, Line 3
Cannot bulk load because the file "C:\crane\COMPANIES.fmt" could not be read. Operating system error code (null).

Solution:
Open your format file press Ctrl-End you should be going to the last line.
If your last line is a column definition you need to go to the end of that line, press enter and Save it.
so you must have an EMPTY LAST LINE in your file.




lunes, 14 de diciembre de 2015

Rmcobol 85 tips

Couple of things.

I was looking for a copy of the manual.

https://www.yumpu.com/en/document/view/9317270/rm-cobol-users-guide-second-edition-micro-focus

I have several index files to convert to sequential you can do it in a batch this is the command line.

runcobol recover2 A="INDEXFILE.INX, SEQUENTIALFILE.TXT ,NOSUB"