I have an array of objects where I wanted make a list of array which is unique while at the same time adding different values to sub property into the distinct object. Example below is an array of a mixture of folders and files, together with it are it details include used size, access users... Continue Reading →
Load XML into Database
Load xml file into store procedure to insert into table. Sample xml file: <?xml version='1.0' encoding='UTF-8' ?> <FctTypes> <reportType>SSS</reportType> <tradingDate>01-Jun-2017</tradingDate> <period>1</period> <Details> <facilityType>AAA</facilityType> <grossInjection>111.11</grossInjection> <netInjection>222.22</netInjection> </Details> <Details> <facilityType>BBB</facilityType> <grossInjection>333.33</grossInjection> <netInjection>555.55</netInjection> </Details> <Details> <facilityType>CCC</facilityType> <grossInjection>122.11</grossInjection> <netInjection>244.22</netInjection> </Details> </FctTypes> <FctTypes> <reportType>SSS</reportType> <tradingDate>01-Jun-2017</tradingDate> <period>2</period> <Details> <facilityType>AAA</facilityType> <grossInjection>111.11</grossInjection> <netInjection>222.22</netInjection> </Details> <Details> <facilityType>BBB</facilityType> <grossInjection>333.33</grossInjection> <netInjection>555.55</netInjection> </Details> <Details> <facilityType>CCC</facilityType> <grossInjection>122.11</grossInjection> <netInjection>244.22</netInjection>... Continue Reading →
Authorization failure for Ajax request in MVC application
I encounter an ajax request authorization failure and causes bad user experience. I had click on a button which require ajax response in my ASP.net MVC application which already timout. Below is the way to handle it properly without getting any bugs. I have created a OnAuthorizationModule action filter to check on each action to determine... Continue Reading →
Responsive display: Inline-block
How to develop a responsive site which size can be adjusted while the display is still able to maintain its sequence and order, displaying a meaning page without running out of order? Basically just have to add an attribute in the style of the div tag will do. For the main div, add display:inline-block in style, while... Continue Reading →
How to use AntiForgeryToken in ASP.NET MVC
Cross-Site Request Forgery (CSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated. CSRF attacks specifically target state-changing requests, not theft of data, since the attacker has no way to see the response to the forged request. With a little help of social... Continue Reading →
HTTP Error 401.0 – Unauthorized
After login, unable to access the pages and below error message display. solution: Go to the project property 2. Change the 'Window Authentication' setting to 'Enabled'
Sending email through store procedure
Database email setup Double click 'Databse Mail' to start setup Create mail configuration select as below key in the profile name and click 'Add' key in email address and the server ip address add the SMTP email address and server ip address click 'Next' click 'Finish' Store Procedure Parse in the profile to be... Continue Reading →
Selecting data from MySql in MSSQL
Setup Link Server right click to add new linked server. Fill in all the appropriate details accordingly. Follow the database name in mysql to be use as data source over here. Provider string: DRIVER={MySQL ODBC 5.3 ANSI Driver};SERVER=ip address;PORT=port number;DATABASE=mt4_demo;USER=username;PASSWORD=password;Option=3 test connection and save it. after setup To query the data from the table... Continue Reading →
Running SSIS package in a database scheduler
Copy excel file/ csv file into the table daily repetitiously. Below is the guide to set the SSIS and use the generate package file in the job scheduler in MSSQL. SSIS Setup Tasks -> Import data client 'Next' select 'Flat file source' Select the file, change text qualifier to ' " ', uncheck the check... Continue Reading →