Profile

Click to view full profile
Hi, I'm Veerapat Sriarunrungrueang, an expert in technology field, especially full stack web development and performance testing.This is my coding diary. I usually develop and keep code snippets or some tricks, and update to this diary when I have time. Nowadays, I've been giving counsel to many well-known firms in Thailand.
view more...

Friday, September 9, 2016

Useful CMD tips

SSRS - By pass specific user to Reporting Server

When we browse to Reporting Server, it usually ask a username and password to access. However, sometime we want to avoid that by using specific account (treat like webapp that know db password). To do that we have to implement a custom web application that host a web page which can load ReportViewer. Then that page have to specifically implement parameter specification before by pass its parameters to ReportViewer control. The steps are shown below:

By pass anonymous access for reports using custom web app as a proxy
  1. Create ReportViewer in custom web app

Create self WCF Windows Service

SSIS - Parameter things

In SQL Server Integration Services, sometime we have to use the values that can be varied on circumstances e.g. parameter. For my frequent cases, there are 2 cases listed below:
  1. SSIS Variables Object - read from DB
These links explain how to load parameter which values are from database, and how to use parater into SQL query task.

Thursday, February 18, 2016

How to add parameters into a WebRequest?

Conditional Logic in PowerShell


Operator
Description
-eq
Equal to
-lt
Less than
-gt
Greater than
-ge
Greater than or Eqaul to
-le
Less than or equal to
-ne
Not equal to


perator
Description
-not
Not
!
Not
-and
And
-or
Or

Query SQL in Powershell

The following snippet will query data from SQL into DataSet format:

$ServerName = "_ServerName_"
$DatabaseName =
"_DatabaseName_"
$Query =
"SELECT * FROM Table WHERE Column = 'XXX'"
#Timeout parameters
$QueryTimeout =
120
$ConnectionTimeout =
30
#Action of connecting to the Database and executing the query and returning results if there were any.
$conn=
New-Object System.Data.SqlClient.SQLConnection
$ConnectionString =
"Server={0};Database={1};Integrated Security=True;Connect Timeout={2}" -f $ServerName,$DatabaseName,$ConnectionTimeout
$conn.
ConnectionString=$ConnectionString
$conn.
Open()
$cmd=
New-Object system.Data.SqlClient.SqlCommand($Query,$conn)
$cmd.
CommandTimeout=$QueryTimeout
$ds=
New-Object system.Data.DataSet
$da=
New-Object system.Data.SqlClient.SqlDataAdapter($cmd)
[
void]$da.fill($ds)
$conn.
Close()
$ds.
Tables

Sunday, June 14, 2015

Run Unit Test as 64 bit in Visual Studio

Sometime you cannot run unit test because it ask you to run on 64 bit. However, changing debug mode does not help and cause you do not see any unit test methods. In order to make it work, You need to go to Test Settings under Test tab then set Default Processor Architecture.

Tuesday, May 19, 2015

Archeblade Internet Server Configuration

To configure Archeblade server, do the following steps:
  1. by default Archeblade server use 3 ports starting with port 7777. For example, if the textbox in Port Num is 7777, it will use ports 7777-7779.
  2. Firewall: disabled or add Inbound Rules in Advance Firewall settings. Then, allow TDP for ports 7777-7779 and another one for UDP in the same ports.
  3. Configure your router for Port-Forwarding to receive incoming port 7777 to local port 7777 on your specific server ip address for both TCP and UDP.                      
  4. Do step 3 more for port 7778 and 7779.
  5. Done

Wednesday, March 4, 2015

Extract Text from PDF in C#

Hi, long time no see. Currently, I am working as a Consultant at Atos Thailand, so I hardly find a good timing to write an interesting post. For today, I will just paste the link for code snippet to hook up PDF content into text using C#. Take a look at http://www.codeproject.com/Articles/14170/Extract-Text-from-PDF-in-C-NET.