Friday, April 10, 2020

msbuild fails to run

When you are trying to publish a web through command line  you might encounter following error

MSBUILD : error MSB1009: Project file does not exist

Fix this by adding msbuild.exe to environement variables


The path is located in the Visual Studio Installed directory.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin

Samitha

Saturday, March 28, 2020

fetch results of a stored procedure

If you want to get results of a executed  stored procedure, there few ways you can achieve the goal.

1. using openrowset

SELECT * INTO #TempTable FROM OPENROWSET('SQLNCLI', 'Server=(local)\SQL2008;Trusted_Connection=yes;',
     'EXEC getOrderHistory')

SELECT * FROM #TempTable

2. using temporary table

INSERT INTO #TempTable
Exec getOrderHistory 'Params'

Regards,
Samitha

Thursday, March 12, 2020

Handling Bootstrap switch checked event

If you are using Bootstrap switch, use the following jquery to track the Bootstrap switch checked event


$('.switcher').on('switchChange.bootstrapSwitch', function (event, state) {
   //more code here
 });

Regards,
Samitha

Sunday, March 1, 2020

Error: ENOENT: no such file or directory

When you are working with node js packages you might encounter  Error: ENOENT: no such file or directory, scandir '**/node_modules/node-sass/vendor' for one or some of the packages you are using.

execute following command for all the packages that gave ENOENT  error and it will fix the issue

cheers
Samitha


Tuesday, February 18, 2020

CSS select label

If we want to apply style for elements rendered  label for   use the following CSS

label[for=ID_of_the_Label]
{
    
}


Cheers,
Samitha

Sunday, February 2, 2020

'gulp' is not recognized as an internal or external command,

I have installed npm and working for the past few months without an issue. I was trying to execute a gulp task and came across the issue of gulp not working. The visual studio output displayed as follows

 'gulp' is not recognized as an internal or external command.

I fixed this issue by re installing gulp using  the following command

npm install -g gulp


Cheers,
Saamitha

Wednesday, January 1, 2020

FluentValidation validating bool

When validating boolean properties  using FluentValidation, use .NotNull() instead of .NotEmpty()

The reason behind this is NotEmpty() will consider only true as valid property whereas NotNull() will consider both true and false as valid properties.

Cheers
Samitha