Pages
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
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
- Create ReportViewer in custom web app
Labels:
ASP.NET,
C#,
Internet Technology,
Programming,
SSRS,
Windows
Create self WCF Windows Service
Check out these links, it help me a lot to allow me creating self WCF and installed it as Windows Service.
Enable CORS in WCF
- Converting WCF CORS restful service from .Net 4.5 to 3.5 causes preflight request to break
- Implementing CORS support in WCF
- http://stackoverflow.com/questions/8854137/i-have-implemented-afterreceiverequest-method-from-idispatchmessageinspector-a
- AJAX JQuery SelfHost WCF -> ByPassCrossDomain Method
- Implementing CORS support in WCF
Labels:
Ajax,
ASP.NET,
C#,
Internet Technology,
Network,
Programming,
WCF,
Windows
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:
These links explain how to load parameter which values are from database, and how to use parater into SQL query task.
Labels:
Programming,
SQL,
SSIS,
Windows
Thursday, February 18, 2016
How to add parameters into a WebRequest?
Take a look at this link: http://stackoverflow.com/questions/3279888/how-to-add-parameters-into-a-webrequest
Labels:
C#,
Programming,
Windows
Conditional Logic in PowerShell
http://www.powershellpro.com/powershell-tutorial-introduction/powershell-tutorial-conditional-logic/
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
|
Labels:
PowerShell,
Programming,
Windows
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'"
$DatabaseName = "_DatabaseName_"
$Query = "SELECT * FROM Table WHERE Column = 'XXX'"
#Timeout parameters
$QueryTimeout = 120
$ConnectionTimeout = 30
$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
$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
Labels:
PowerShell,
Programming,
SQL,
Windows
Subscribe to:
Posts (Atom)