Welcome To My Blog

This blog contains posts that may benefit ordinary visitors or programmers (particularly .NET programmer).
To view posts related to particular subjects, click the link under Labels.

Wednesday, September 24, 2008

List of Culture Codes

The following list may be useful for programmers especially those .NET programmers who write application using resource files.

List of Culture Codes

Code

Language - Country/Region

Code

Language - Country/Region

af

Afrikaans

hu-HU

Hungarian - Hungary

af-ZA

Afrikaans - South Africa

is

Icelandic

sq

Albanian

is-IS

Icelandic - Iceland

sq-AL

Albanian - Albania

id

Indonesian

ar

Arabic

id-ID

Indonesian - Indonesia

ar-DZ

Arabic - Algeria

it

Italian

ar-BH

Arabic - Bahrain

it-IT

Italian - Italy

ar-EG

Arabic - Egypt

it-CH

Italian - Switzerland

ar-IQ

Arabic - Iraq

ja

Japanese

ar-JO

Arabic - Jordan

ja-JP

Japanese - Japan

ar-KW

Arabic - Kuwait

kn

Kannada

ar-LB

Arabic - Lebanon

kn-IN

Kannada - India

ar-LY

Arabic - Libya

kk

Kazakh

ar-MA

Arabic - Morocco

kk-KZ

Kazakh - Kazakhstan

ar-OM

Arabic - Oman

kok

Konkani

ar-QA

Arabic - Qatar

kok-IN

Konkani - India

ar-SA

Arabic - Saudi Arabia

ko

Korean

ar-SY

Arabic - Syria

ko-KR

Korean - Korea

ar-TN

Arabic - Tunisia

ky

Kyrgyz

ar-AE

Arabic - United Arab Emirates

ky-KG

Kyrgyz - Kyrgyzstan

ar-YE

Arabic - Yemen

lv

Latvian

hy

Armenian

lv-LV

Latvian - Latvia

hy-AM

Armenian - Armenia

lt

Lithuanian

az

Azeri

lt-LT

Lithuanian - Lithuania

az-AZ-Cyrl

Azeri (Cyrillic) - Azerbaijan

mk

Macedonian

az-AZ-Latn

Azeri (Latin) - Azerbaijan

mk-MK

Macedonian - Former Yugoslav Republic of Macedonia

eu

Basque

ms

Malay

eu-ES

Basque - Basque

ms-BN

Malay - Brunei

be

Belarusian

ms-MY

Malay - Malaysia

be-BY

Belarusian - Belarus

mr

Marathi

bg

Bulgarian

mr-IN

Marathi - India

bg-BG

Bulgarian - Bulgaria

mn

Mongolian

ca

Catalan

mn-MN

Mongolian - Mongolia

ca-ES

Catalan - Catalan

no

Norwegian

zh-HK

Chinese - Hong Kong SAR

nb-NO

Norwegian (Bokm�l) - Norway

zh-MO

Chinese - Macao SAR

nn-NO

Norwegian (Nynorsk) - Norway

zh-CN

Chinese - China

pl

Polish

zh-CHS

Chinese (Simplified)

pl-PL

Polish - Poland

zh-SG

Chinese - Singapore

pt

Portuguese

zh-TW

Chinese - Taiwan

pt-BR

Portuguese - Brazil

zh-CHT

Chinese (Traditional)

pt-PT

Portuguese - Portugal

hr

Croatian

pa

Punjabi

hr-HR

Croatian - Croatia

pa-IN

Punjabi - India

cs

Czech

ro

Romanian

cs-CZ

Czech - Czech Republic

ro-RO

Romanian - Romania

da

Danish

ru

Russian

da-DK

Danish - Denmark

ru-RU

Russian - Russia

div

Dhivehi

sa

Sanskrit

div-MV

Dhivehi - Maldives

sa-IN

Sanskrit - India

nl

Dutch

sr-SP-Cyrl

Serbian (Cyrillic) - Serbia

nl-BE

Dutch - Belgium

sr-SP-Latn

Serbian (Latin) - Serbia

nl-NL

Dutch - The Netherlands

sk

Slovak

en

English

sk-SK

Slovak - Slovakia

en-AU

English - Australia

sl

Slovenian

en-BZ

English - Belize

sl-SI

Slovenian - Slovenia

en-CA

English - Canada

es

Spanish

en-CB

English - Caribbean

es-AR

Spanish - Argentina

en-IE

English - Ireland

es-BO

Spanish - Bolivia

en-JM

English - Jamaica

es-CL

Spanish - Chile

en-NZ

English - New Zealand

es-CO

Spanish - Colombia

en-PH

English - Philippines

es-CR

Spanish - Costa Rica

en-ZA

English - South Africa

es-DO

Spanish - Dominican Republic

en-TT

English - Trinidad and Tobago

es-EC

Spanish - Ecuador

en-GB

English - United Kingdom

es-SV

Spanish - El Salvador

en-US

English - United States

es-GT

Spanish - Guatemala

en-ZW

English - Zimbabwe

es-HN

Spanish - Honduras

et

Estonian

es-MX

Spanish - Mexico

et-EE

Estonian - Estonia

es-NI

Spanish - Nicaragua

fo

Faroese

es-PA

Spanish - Panama

fo-FO

Faroese - Faroe Islands

es-PY

Spanish - Paraguay

fa

Farsi

es-PE

Spanish - Peru

fa-IR

Farsi - Iran

es-PR

Spanish - Puerto Rico

fi

Finnish

es-ES

Spanish - Spain

fi-FI

Finnish - Finland

es-UY

Spanish - Uruguay

fr

French

es-VE

Spanish - Venezuela

fr-BE

French - Belgium

sw

Swahili

fr-CA

French - Canada

sw-KE

Swahili - Kenya

fr-FR

French - France

sv

Swedish

fr-LU

French - Luxembourg

sv-FI

Swedish - Finland

fr-MC

French - Monaco

sv-SE

Swedish - Sweden

fr-CH

French - Switzerland

syr

Syriac

gl

Galician

syr-SY

Syriac - Syria

gl-ES

Galician - Galician

ta

Tamil

ka

Georgian

ta-IN

Tamil - India

ka-GE

Georgian - Georgia

tt

Tatar

de

German

tt-RU

Tatar - Russia

de-AT

German - Austria

te

Telugu

de-DE

German - Germany

te-IN

Telugu - India

de-LI

German - Liechtenstein

th

Thai

de-LU

German - Luxembourg

th-TH

Thai - Thailand

de-CH

German - Switzerland

tr

Turkish

el

Greek

tr-TR

Turkish - Turkey

el-GR

Greek - Greece

uk

Ukrainian

gu

Gujarati

uk-UA

Ukrainian - Ukraine

gu-IN

Gujarati - India

ur

Urdu

he

Hebrew

ur-PK

Urdu - Pakistan

he-IL

Hebrew - Israel

uz

Uzbek

hi

Hindi

uz-UZ-Cyrl

Uzbek (Cyrillic) - Uzbekistan

hi-IN

Hindi - India

uz-UZ-Latn

Uzbek (Latin) - Uzbekistan

hu

Hungarian

vi

Vietnamese

Tuesday, September 16, 2008

Using MasterPage Template In ASP.Net 2005 Application

Introduction

A Master Page in Visual Studio 2005 is just like a template. You can place banners, menus, images and etc on the master page. You can also include codes (functions) on the master page. You can include more than one master page in any asp.net 2005 web application.

Once you have the master page, you can generate the content page (aspx page) which is linked to the master page. This way, you can have several aspx pages (content pages) with a consistent look. In other words, all content pages generated using a master page, will have the same appearance as the master page. For example, if you have placed a banner at the top and navigation menu on the left side of the master page, all content pages will also have the banner at the top and menu on the left side.

How To Add Master Page To ASP.Net Project?
Adding a master page to an ASP.NET project is very easy. You just need to do the following steps:
  1. Right-click on the project name in the Solution Explorer window.
  2. Select Add New Item... from the pop up menu.
  3. Select Master Page from the Add New Item dialog box. If necessary, change the name and the language for the master page. Then click the Add button. You will see a master page is displayed either in the Source or Design view.
  4. Design you master page. For example, you can add an HTML table on the master page. After that, you can arrange the the ContentPlaceHolder control, images, buttons and other controls nicely within the HTML table. You may look at the image below for an example.

How To Add Content Page (aspx page) Using A Master Page?
To add a content page to your asp.net project using a particular master page is relatively easy. All you need to do are:
  1. Open the particular master page that you want to use to generate the master page.
  2. Right-click anywhere within the Design or Source view window and select Add Content Page from the pop up menu that appears.
  3. Notice the asp.net content control in the generated aspx page. This is where you place your content such as text, iframe, images and etc for your content page.
Remember that we use master page to generate a consistent aspx page. Though you cannot set a master page as the start page of your website, you still need to include it in your asp.net web site. This is because the page that is generated using the master page has a link to the master page.

Sunday, September 14, 2008

How To Define SQL Parameters In C# (VS2005)

Hi there...

This post is dedicated to programmers (beginners) who want to use SQL statements when coding in C#. Before I continue, let me ask you something. Do you know what a parameter in an SQL statement is?

A parameter is just like a placeholder or variable where you define the location for the actual value in the SQL statement. Since it works like a variable, the value can be changed anytime during the SQL execution. Examples are as follow:

SELECT * FROM Employees WHERE EmployeeID = @EmployeeID;

UPDATE Employees SET FirstName=@FirstName WHERE EmployeeID = @EmployeeID;

DELETE Employees WHERE EmployeeID = @EmployeeID;

INSERT INTO Employees (EmployeeID, FirstName, LastName) VALUES (@EmployeeID, @FirstName, @LastName);

In the above examples, @EmployeeID, @FirstName and @LastName are called parameters. A parameter represents a value that you need to set (or assigned) before you execute the particular SQL statement that contains it.

The question now is how are we going to do it in C#? Let's assume you want to use a SELECT statement in the SqlCommand object.

You got to follow the steps below:
  1. Define an SQL Connection object, example:
    SqlConnection conNorthwind = new SqlConnection("server=localhost;uid=sa;pwd=;database=northwind;");
  2. Define an SQL Command object, example:
    SqlCommand cmdEmployees = new SqlCommand("SELECT * FROM Employees WHERE EmployeeID = @EmployeeID", conNorthwind);
  3. Define a parameter and pass the value from a textbox to it. Then, add it to the SqlCommand parameters collection, example:
    SqlParameter paraEmployeeID = new SqlParameter("@EmployeeID", txtEmployeeID.Text);
    cmdEmployees.Parameters.Add(paraEmployeeID);
  4. Open the SqlConnection, example:
    conNorthwind.Open();
  5. Now you may pass the command object to an SqlDataReader or SqlDataAdapter.
    To pass it to an SqlDataReader, you may do the following:
    SqlDataReader drEmployees = cmdEmployees.ExecuteReader();
    To pass it to an SqlDataAdapter, do the following:
    SqlDataAdapter daEmployees = new SqlDataAdapter(cmdEmployees);
  6. If you pass the command object to an SqlDataReader using the ExecuteReader method, you can display the retrieved rows directly in a GridView (web control) using the following code:
    GridView1.DataSource = drEmployees;
    GridView1.DataBind();
  7. If you pass the command object to an SqlDataAdapter, you have to define a dataset also since a DataAdapter can only work with a DataSet. Assuming that you want to display the result in the same web control (GridView). You may write the following codes:
    Dataset dsNorthwind = new DataSet();
    //"Employees" is just a datatable name. It can be replaced with any name.
    daEmployees.Fill(dsNorthwind, "Employees");
    GridView1.DataSource = dsNorthwind.Tables["Employees"];
    GridView1.DataBind();
  8. Finally, close the connection as follows:
    conNorthwind.Close();
Notes: If you are using an SqlDataAdapter, it is not necessary to open and close the connection explicitly. This is because the SqlDataAdapter can open and close the connection implicitly.

Friday, September 12, 2008

Google Sudah Lancarkan Browser Sendiri

Rasanya ramai pengguna internet tahu apa itu Google -- sebuah syarikat internet yang menyediakan Enjin Carian secara percuma. Baru-baru ini Google telah melancarkan "internet browser"nya sendiri yang dikenali dengan nama Google Chrome.

Saya telah mencuba browser ini dan saya dapati ianya agak pantas berbanding browser-browser lain seperti Internet Explorer dan Firefox. Antaramuka (interface) untuk browser ini nampak ringkas dan mudah untuk digunakan. Walaupun masih di peringkat "beta version", browser ini dapat memaparkan sebarang laman tanpa masalah.

Untuk mengetahui lebih lanjut tentang browser ini, sila klik pautan (link) di bawah:
http://www.google.com/chrome
Untuk memuatturun (download) offline-installer untuk browser ini, sila klik pautan di bawah:
chrome_installer.exe

Thursday, September 11, 2008

Penyerahan Borang Cadangan Takaful Etiqa

Assalamualaikum...

Artikel ini ditujukan khas kepada wakil-wakil Etiqa Takaful. Untuk penyerahan borang cadangan takaful, anda perlu menyediakan sekurang-kurang 4 dokumen tersebut:
  1. Salinan kad pengenalan pelanggan takaful.
  2. Borang carian fakta pelanggan.
  3. Borang cadangan untuk menyertai pelan takaful.
  4. Ilustrasi pelan.
Jika pelan yang dicadangankan turut mengandungi pelan sampingan Penyakit Kritikal (Critical Illness), anda juga perlu menyertakan borang untuk Critical Illness.

Kesemua borang boleh didapati di kaunter Etiqa cawangan anda.

Untuk keterangan lanjut, sila bertanya dengan Agency Manager atau Group Agency Manager anda.