The Web Service threw an error during method execution. The error is: Unable to connect to the remote server at Microsoft.SqlServer.Dts.Tasks.WebServiceTask

This post shows you one of the possibilities to resolve the error above. I have written to Microsoft team in email as below.

I spent a day to troubleshoot this but no luck. I have web service running fine in slightly older Visual Studio 2015. Running fine with browse through IIS. Windows Server is Windows 2012 R2. SQL Server in this machine still SQL Server 2014.


When I run it in Web Service Task with SSIS then I got this error:

[Web Service Task] Error: An error occurred with the following error message: “Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException: The Web Service threw an error during method execution. The error is: Unable to connect to the remote server.  at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebMethodInvokerProxy.InvokeMethod(DTSWebMethodInfo methodInfo, String serviceName, Object connection)

   at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTaskUtil.Invoke(DTSWebMethodInfo methodInfo, String serviceName, Object connection, VariableDispenser taskVariableDispenser)

   at Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebServiceTask.executeThread()


– I tried to recreate the wsdl file but not working

– Set IIS pool and others, not work

– I run exactly the same package in other server with the same Visual Studio 2015, Win Server 2012 R2 and SQL Server 2014 but is fine.

No one from MS team is replying me. I somehow found out in some machines localhost is will not work like http://localhost/WSEGATA/WSATAPriority.asmx. Not sure about the reason. At the same time, you need to regenerate the wsdl file using the like with IP address and not localhost.

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment

Ubuntu Hyper-V display resolution

This short post shows you how to change the display resolution in Ubuntu when you have your ubuntu in Hyper-V.

Go to you Terminal in Windows people call in command prompt then type the following.

sudo nano /etc/default/grub

Change this line:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”

To this.

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash video=hyperv_fb:1600×900″

Then in a console type:

sudo update-grub

This works for me

References: https://askubuntu.com/questions/702628/ubuntu-hyper-v-guest-display-resolution-win-10-15-04

Posted in Community, Computers and Internet, Operating System, Servers | Tagged | Leave a comment

Webassembly with C++ Ubuntu

This post shows you how to create Webassembly in Ubuntu 10.08. I get 2 links one is https://medium.com/@cchaconsartori/introduction-to-webassembly-with-c-part-i-64bcfad7ecb4 and another is https://medium.com/@tdeniffel/pragmatic-compiling-from-c-to-webassembly-a-guide-a496cc5954b8. Unfortunately you need to combine these two to make it works for now. Whether it will continue to break in future then I cannot tell you. I tried this whole afternoon to just make it works. Hope you don’t need the whole afternoon.

After you have done installing Ubuntu. Don’t issue the follow command.

$ sudo apt update

till you run

$ sudo apt install build-essential cmake python git

The article is stating

$ apt install build-essential cmake python git

Bet what, it will give you error.

Follow you run this 5 commands.

$ git clone https://github.com/juj/emsdk.git

$ cd emsdk

$ ./emsdk install latest

$ ./emsdk activate latest

$ source ./emsdk_env.sh –build=Release

Create a hello.cpp as follow.

$ cat hello.cpp

#include<iostream>

int main() {

std::cout << “Hello World” << std::endl;

return 0;

}

Compile the code.

$ em++ hello.cpp -s WASM=1 -o hello.html

Run the code

$ emrun hello.html

s

Posted in .Net, Cloud, Community, Computers and Internet, Operating System, Servers | Tagged | Leave a comment

Windows Hello Fingerprint not working

This post show you one of the possible ways to resolve Windows Hello Pin or Windows Hello Fingerprint cannot function.

In short you have to rename C:\Windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\Ngc to something else. The below video link has the step by step.

References: https://youtu.be/m_c2QrPcgUU s

Posted in .Net, Cloud, Community, Computers and Internet, Operating System | Tagged | Leave a comment

PowerShell compare date then move file

This post shows you how to compare move the file to another location based on the date. It sounds simple but I could not find a single location showing me the code below. I combined 3 links under the references to get this done.

Firstly, I assign the source path to $file variable.

$files = Get-ChildItem “c:\sales”

I then loop through the source folder.

foreach ($file in $files)

Compare the file date is greater than yesterday.

if ($file.CreationTime -gt (get-date).AddDays(-1))

Move file to C:\temp\others folder.

Move-Item -Path $file.FullName -Destination C:\temp\others

The complete code as follow.

$files = Get-ChildItem “c:\sales”

foreach ($file in $files)

{

    if ($file.CreationTime -gt (get-date).AddDays(-1))

    {

        Move-Item -Path $file.FullName -Destination C:\temp\others

    }

}

Refernces: https://stackoverflow.com/questions/29440314/powershell-foreach-file-in-files, https://social.technet.microsoft.com/Forums/ie/en-US/b5dbe9fc-e716-44ca-8f18-36864bcae791/powershell-getdate-minus-one-day?forum=ITCG, https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/move-item?view=powershell-7

Posted in .Net, Cloud, Community, Computers and Internet, Operating System, Servers | Tagged | Leave a comment

CTO Articles March 2020

This post shares the articles and videos good for CTO.

Executive Spotlight: Top Priorities For Security And Risk Leaders In 2019. This document showing a good security transformation.

https://1drv.ms/b/s!Aje-DdIVpfjSi2b7rM_2d8ZkGHmL

Four ways to maximize your business intelligence investments

https://1drv.ms/b/s!Aje-DdIVpfjSi2geksh8VqN4d6Vb?e=cDSSp1

The Sprawling Reach of Complex Threats

https://1drv.ms/b/s!Aje-DdIVpfjSi2cn8pmF6SX2dtNH

The good point on the video below “You don’t need Object-Oriented programming to do 1+1”.

https://www.youtube.com/watch?v=cN9c_JyvL1A&t=5s

Posted in .Net, Cloud, Community, Computers and Internet, CTO, Data Platform | Tagged | Leave a comment

SQL Server convert varbinary blob to Excel

This post shows you the code to convert SQL Server varbinary field back to Excel. You might get some errors if you are using the code here https://chanmingman.wordpress.com/2011/06/21/read-image-file-blob-from-binary-field-in-ms-sql-database/. The pre-requisite of this post is you need to know ADO.NET.


The code I have tested success in all the convert is the one below.

public static void ExportExcelFromDB()

{

    string filepathtostore = @”C:\temp\QIFFARAH_VENTURES_SB.xlsx”;

    RetrieveExcelFileFromDatabase(12096, filepathtostore);

}

public static void RetrieveExcelFileFromDatabase(int ID, string excelFileName)

{

    byte[] excelContents;

    string selectStmt = “Select [ATTACHFILE] From ATTACHMENT WHERE [ATTACHFILE] IS NOT NULL AND[ATTACHMENT_ID] = @ID”;

    using (SqlConnection connection = new SqlConnection(“Data Source =172.10.10.01; Initial Catalog = blob; Integrated Security = True”))

    using (SqlCommand cmdSelect = new SqlCommand(selectStmt, connection))

    {

        cmdSelect.Parameters.Add(“@ID”, SqlDbType.Int).Value = ID;

        connection.Open();

        excelContents = (byte[])cmdSelect.ExecuteScalar();

        connection.Close();

    }

    File.WriteAllBytes(excelFileName, excelContents);

Complete code: https://github.com/chanmmn/SQLBlobExcel

References: https://social.technet.microsoft.com/wiki/contents/articles/34919.import-and-export-excel-files-into-varbinary-max-in-sql-server.aspx

Posted in .Net, Cloud, Community, Computers and Internet, Data Platform | Tagged | Leave a comment