Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Internationalization / January 2007

Tip: Looking for answers? Try searching our database.

How to Store numbers in other languages?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Meena - 04 Jan 2007 06:28 GMT
My Back End is SQL Server and Front End is VB.Net.
The Int data type of SQL Server doesn't seem to support numbers of other
languages.
It only supports numbers in Latin script.
How do I store numbers of different languages in SQL Server from VB.Net???
Any help would be really useful.

Regards
Meena
Mihai N. - 05 Jan 2007 07:06 GMT
> My Back End is SQL Server and Front End is VB.Net.
> The Int data type of SQL Server doesn't seem to support numbers of other
> languages.
> It only supports numbers in Latin script.
> How do I store numbers of different languages in SQL Server from VB.Net???
> Any help would be really useful.

For non-Latin1 strings, you need Unicode fields (NCHAR, NVARCHAR)

But for numbers, you should use numeric fields, which are language
independent. And you have to convert them from/to language specific formats
for presentation only.

Signature

Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

Meena - 06 Jan 2007 11:22 GMT
How do I convert them from/to language specific formats for presentation???

Regards
Meena

>> My Back End is SQL Server and Front End is VB.Net.
>> The Int data type of SQL Server doesn't seem to support numbers of other
[quoted text clipped - 10 lines]
> formats
> for presentation only.
Mihai N. - 06 Jan 2007 19:58 GMT
> How do I convert them from/to language specific formats for presentation???

Start from "Working with Base Types" (http://msdn2.microsoft.com/en-
us/library/7wchwf6k.aspx):
- "Formatting Types" (converting to language specific formats)
- "Parsing Strings" (converting from language specific formats)

Here are some parsing example:
http://msdn2.microsoft.com/en-us/library/xbtzcc4w.aspx
  using System.Globalization;

  string MyString = "123,456";
  int MyInt = int.Parse(MyString);

And some formatting example:
http://msdn2.microsoft.com/en-us/library/dwhawy9k.aspx
  using System.Globalization;

  int    integralVal = -12345;
  double floatingVal = -1234.567d;

  string msgFloatingVal = floatingVal.ToString("F")); // see also E,F,G,N,P
  string msgIntegralVal = integralVal.ToString("D", ci)); // see also X

This should get you started :-)
Mihai

Signature

Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.