Search
  ..:: Articles ::.. Register  Login

Current Articles | Categories | Search | Syndication

Tuesday, October 22, 2002
How to program in VB.NET to provide UNICODE Indic titles & input
By srinivas.annam @ 9:31 PM :: 2366 Views :: 3 Comments ::

Pre-requisites:

Platform: Windows 98, ME, NT4, 2000 or XP
IDE: VB.NET
Database: Access 2000 or later (NOTE: storage format is same between Access 2000 or Access XP, but proper Indic display within Access requires Access XP)
Aksharamala: 2002 Pro or evaluation (for the languages of your choice)

Summary:

The sample given below shows a small banking application illustrating how to code in VB.NET for Indic titles & input. In this sample we create new accounts with minimum data to be accepted and display the same using a listview control. The main focus of this sample is to display and accept the data in Indian languages (in this case Hindi Transliteration Scheme).

Design

In this sample we used a form that has two tabs, one for accounts listing and another for account details as shown in Figure 1 and Figure 2.


Figure 1


Figure 2

Setting the properties of the controls during the design time

To set the text property of a control in Indian Language (say Hindi Language), enable Hindi Transliteration Scheme from the Aksharamala tray icon (Figure 3) and go to the properties window in visual studio to set the properties of the selected control (Figure 4).


Figure 3


Figure 4

After setting the properties, save the project file. As the form has Unicode characters, one has to save the form with Unicode encoding using save as option (Figure 5). This  will prompt with "Advance Save Options" dialog as shown in Figure 6. Select "Unicode UTF-8 without signature" as shown in Figure 6 and save the file.


Figure 5


Figure 6

Database

For this example we have created MS-ACCESS 2000 database named vbnet1.mdb. The table structure for the bank table using in this example is show below (Figure 7).

The properties of the fields are as follows

  • AccountNo - Number - Long Integer
  • Name - Text
  • BranchCode - Number - Byte
  • AccountType - Number - Byte
  • ATMReq - Number - Byte
  • Balance - Number - Decimal


Figure 7

Events/Actions

Application Startup

During the application startup, data is read from the database and is populated in the listview control as shown in Figure 8 (if no data is present a blank listview is displayed).


Figure 8

View Account Details

Viewing account details can be done by any one of the ways described below.

  • Select an item from the listview and double click on it (Figure 9)
  • Select an item from the listview and click the button (Figure 9)
  • Select an item from the listview and click the menu item (Figure 10)


Figure 9


Figure 10

This will display the selected account details as shown in Figure 11.


Figure 11

Create New Account

To create a new account click on button (Figure 9). This will display the account details screen as shown in Figure 12. Enter the data and press "Save" button. This will save the data to the database and displays the accounts list screen (Figure 9), but the record added will not be displayed in the list. One can click on "Read From Database" to retrieve the data from the database. Pressing "Cancel" button will cancel the operation and returns back to the accounts list screen (Figure 9).


Figure 12

Retrieve Data from Database

To retrieve data from database click on button "Read From Database". This will populate the data read from the database in the listview control as shown in Figure 8 (if no data is present a blank listview is displayed).

Clear List Entries

To clear the items in the listview control click on button "Clear List Entries". This will clear all the items in the listview control.

Notes

  • For simplicity, security, user and database validations are omitted in this example. Users are advised to implement their own security, user and database validations.
  • As data access procedures are different for different databases in .NET environment, users are advised to refer to .NET and database vendor specific help for accessing the data. As the primary focus of this application is to show how to use VB.NET for Aksharamala, the other details are left for the user to explore.
  • In this example, OleDB classes are used to connect to MS-ACCESS 2000 database.
  • For simplicity, few things are hard coded. For example values 1 to 3 for branches are stored in database, though the data being displayed is branch name. This is done intentionally to avoid multiple tables for this example.
Comments
By Anonymous @ Wednesday, February 15, 2006 7:48 AM
interesting
very nice

By nshriramoju @ Tuesday, November 18, 2008 1:41 AM
It's very helpful.
I like this Logic..

By mihir20082610 @ Friday, November 28, 2008 2:23 AM
can i download the source code??When I click it says you do not have permission to view the source code?? mail the link at seemih@sify.com

Click here to post a comment
Copyright 2006 by Srinivas Annam   Terms Of Use | Privacy Statement