admin

This user hasn't shared any biographical information


Posts by admin

Ask for username and password when calling reporting service

June 22, 2010 - 10:42 am

Tags: , , , , , , ,
Posted in Reporting Services | No comments

These code allow us to set username and password for reporting services to avoid popup request authentication.
This code tested in Visual Studio 2008 and Reporting Services from SQL Server 2005
First create a class called ReportServerCredentials.vb

Imports Microsoft.VisualBasic
Imports Microsoft.Reporting.WebForms
Imports System.Security.Principal

Public NotInheritable Class ReportServerCredentials
Implements IReportServerCredentials

Public ReadOnly Property ImpersonationUser() As WindowsIdentity [...]

  • Share/Bookmark

Send Email with multiple attachments from VB.NET

June 3, 2010 - 4:43 pm

Tags: , , , , ,
Posted in VB.NET | No comments

This code show how to send email multiple attachments from vb.net by using System.Net.Mail
1. This is how you use it

Dim fileAttch = New ArrayList
fileAttch.Add("C:\test.csv")
fileAttch.Add("C:\test2.csv")
fileAttch.Add("C:\test3.csv")

sendEmail.send(your_emailHost, "no-reply@company.com", your_EmailTo, your_EmailSubject, your_EmailBody, your_EmailccTo, fileAttch)

  • Share/Bookmark

Get first day of the month and last day of the month in VB.NET

June 3, 2010 - 4:31 pm

Tags: , , , ,
Posted in VB.NET | No comments

This code show how to get first date of the month and last day of the month date.

Private Function GetFirstDayOfMonth(ByVal dtDate As DateTime) As DateTime
Dim dtFrom As DateTime = dtDate
dtFrom = dtFrom.AddDays(-(dtFrom.Day – 1))
[...]

  • Share/Bookmark

VB.NET Set Data Table to CSV File

June 3, 2010 - 4:22 pm

Tags: , , , , ,
Posted in VB.NET | No comments

This function show how to Convert DataTable to CSV File

Sub SetDataTable_To_CSV(ByVal dtable As DataTable, ByVal path_filename As String, ByVal sep_char As String)
Dim writer As System.IO.StreamWriter
Try
[...]

  • Share/Bookmark

Its not Iron Man but its Iron baby

June 2, 2010 - 4:43 pm

Tags: , , , ,
Posted in Uncategorized | No comments

A VIDEO of a baby girl dressed as Iron Man has become an internet sensation after the child’s filmmaker father posted the clip on YouTube.
Iron Baby, which features Margaret transforming from toddler to iron-clad superhero, has attracted 2.6 million hits so far, the Daily Mail reports.
The parody short film was directed by Margaret’s father Patrick [...]

  • Share/Bookmark

Marina Bay Sands Singapore

May 1, 2010 - 9:29 am

Tags: , , , ,
Posted in My Photo Fun | No comments

Its Saturday morning, I took this picture at 6am. Marina Bay Sands 95% completed.
Amazon.com Widgets

  • Share/Bookmark

How to set command Timeout for getData() in TableAdapter

February 4, 2010 - 11:26 am

Tags: , , , , , ,
Posted in VB.NET | 1 comment

One of the disadvantages when we using tableadapter to retrieve the data from database is they do not provide property to set command timeout (SHIT). This giving me a huge headache for my project which most of the entire project is using tableadapter instead of creating my own DAL or class.
After do some research on [...]

  • Share/Bookmark

VB.NET Date Time Format Patterns

January 15, 2010 - 10:00 am

Tags: , , , ,
Posted in VB.NET | No comments

Standard Format Example List:

Format
Code
Result

MM/dd/yyyy
Date.Now().ToString(”d”)
1/15/2010

dddd, dd MMMM yyyy
Date.Now().ToString(”D”)
Friday, January 15, 2010

dddd, dd MMMM yyyy hh:mm tt
Date.Now().ToString(”f”)
Friday, January 15, 2010 11:06 AM

dddd, dd MMMM yyyy HH:mm:ss
Date.Now().ToString(”F”)
Friday, January 15, 2010 11:06:46 AM

MM/dd/yyyy h:mm tt
Date.Now().ToString(”g”)
1/15/2010 11:06 AM

MM/dd/yyyy HH:mm:ss
Date.Now().ToString(”G”)
1/15/2010 11:06:46 AM

MMMM dd
Date.Now().ToString(”m”)
January 15

dd MMM yyyy HH’:’mm’:’ss ‘GMT’
Date.Now().ToString(”r”)
Fri, 15 Jan 2010 11:06:46 GMT

yyyy’-’MM’-’dd’T’HH’:’mm’:’ss
Date.Now().ToString(”s”)
2010-01-15T11:06:46

yyyy’-’MM’-’dd HH’:’mm’:’ss’Z’
Date.Now().ToString(”u”)
2010-01-15 11:06:46Z

dddd, MMMM dd yyyy HH:mm:ss
Date.Now().ToString(”U”)
Friday, January [...]

  • Share/Bookmark

How to format date time in SQL? – SQL Server Date Time Format

January 15, 2010 - 9:08 am

Tags: , ,
Posted in SQL Server | No comments

getdate() = Jan 14 2010 10:00:05:190PM

Format
Query
Result

USA mm/dd/yy
select convert(varchar, getdate(), 1)
01/14/10

ANSI yy.mm.dd
select convert(varchar, getdate(), 2)
10.01.14

British/French dd/mm/yy
select convert(varchar, getdate(), 3)
14/01/10

German dd.mm.yy
select convert(varchar, getdate(), 4)
14.01.10

Italian dd-mm-yy
select convert(varchar, getdate(), 5)
14-01-10

dd mon yy
select convert(varchar, getdate(), 6)
14 Jan 10

Mon dd, yy
select convert(varchar, getdate(), 7)
Jan 14, 10

HH:MI:SS
select convert(varchar, getdate(), 8 )
21:54:31

Mon dd yyyy H:MI:SS:msAM/PM
select convert(varchar, [...]

  • Share/Bookmark

Chinese Garden Singapore January 01 / 2009

January 2, 2010 - 6:48 pm

Tags: , , , ,
Posted in My Photo Fun | No comments

These are a view photo that I took from my Canon 450D. The location of this is Chinese garden in Singapore. I must say, it is very beautiful park they got in there. Is not only Chinese garden, but there is also Japanese garden.

  • Share/Bookmark