Monday, July 21, 2008

Let's Talk about .. Visual Stuido 2005-Open new window

I found one of the methods to open new windows (redirect to new page) from http://forums.asp.net/t/1161626.aspx
This is how to redirect to new page.

response.write("");

Let's Talk about .. SQL 2005-Summation

The syntax to sum column A and B to be Summation is
[SQL]
Select sum (A+B) As Summation
,C
Group By A,B,C

Wednesday, July 9, 2008

Let's Talk about .. MOSS 2007-Permission Read VS View Only

Read: Read only
View Only: we can see only page but some documents cannot be seen

Tuesday, July 8, 2008

Let's Talk about .. SQL Server 2005-Cast variable type

This is a way to cast the type of variable from String to Decimal
[SQL]
Declare @CurrentYear as varchar(4)
set @CurrentYear = Cast(@NextYear as decimal(18,3))-1

Friday, July 4, 2008

Let's Talk about .. Visual Studio 2005-Show Currency Format

I found on this website http://msconline.maconstate.edu/tutorials/ASPNET2/ASPNET07/aspnet07-01.aspx about how to show a text string with the format of the number (show comma symbol every 3 positions) and currency (show the currency symbol and comma symbol every 3 positions). In that website, there are two ways to show.

[VB.Net]
NumberResult.Text = String.Format("{0:N}", 111.11)
CurrencyResult.Text = String.Format("{0:C}", 222.22)

,and the second method..

[VB.net]
Dim Value As Decimal = 3333.33
NumberResult.Text = String.Format("{0:#,#.###}", Value)

CurrencyResult.Text = String.Format("{0:$ #,#.##}", Value)

Thursday, July 3, 2008

Let's Talk about .. SQL Server 2005-Case..When

Today P'Tao told me how to use case and when in SQL. This is the example.
[SQL]
SELECT Product_ID
, Sample =
CASE Word
WHEN 'A' THEN 'Apple'
WHEN 'B' THEN 'Banana'
WHEN 'C' THEN 'Coconut'
ELSE 'Panda' END
, Description
FROM Production.Product

Wednesday, July 2, 2008

Let's Talk about .. Visual Stuido 2005-Currency format in Grid view

      Since I use a grid view to show my data, it shows the numeric data without comma and currency symbols. Thus, I searched the method and found that this website provides the solution to me http://forums.msdn.microsoft.com/ja-JP/vbgeneral/thread/88d1abd8-9a37-4f55-ac4d-52a82e14c46f/

    The solution is adding HtmlEncode="False" and DataFormatString="{0:c} in to the code.

    For example,