473,770 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying localization with Sams Tips&Tricks

Hi,

I have a very good book on asp.net Sams ASP.NET Tips, Tutorials and Code
ISBN 0-672-32143-2 and is trying to teach myself from examples from this book
Chapter 16.

Anyway I come quite close when trying to run one example but then I get this
message I don't understand:

"This .resources file shouldn't be used with this reader. Your resource
reader type: System.Resource s.ResourceReade r, mscorlib, Version=1.0.241 1.0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"

What does it mean?

Seems my english isn't good enough.

TIA

Kenneth P
Nov 18 '05 #1
3 2094
Hi,

can you post us the code ?

regards
Joyjit

"Kenneth P" <Ke******@discu ssions.microsof t.com> wrote in message
news:62******** *************** ***********@mic rosoft.com...
Hi,

I have a very good book on asp.net Sams ASP.NET Tips, Tutorials and Code
ISBN 0-672-32143-2 and is trying to teach myself from examples from this book Chapter 16.

Anyway I come quite close when trying to run one example but then I get this message I don't understand:

"This .resources file shouldn't be used with this reader. Your resource
reader type: System.Resource s.ResourceReade r, mscorlib, Version=1.0.241 1.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9"

What does it mean?

Seems my english isn't good enough.

TIA

Kenneth P

Nov 18 '05 #2
Hmmm...

Where should I post it, because it contains five very small (1kb) compiled
resource files as well as the code?

Kenneth P
"Joyjit Mukherjee" wrote:
Hi,

can you post us the code ?

regards
Joyjit

"Kenneth P" <Ke******@discu ssions.microsof t.com> wrote in message
news:62******** *************** ***********@mic rosoft.com...
Hi,

I have a very good book on asp.net Sams ASP.NET Tips, Tutorials and Code
ISBN 0-672-32143-2 and is trying to teach myself from examples from this

book
Chapter 16.

Anyway I come quite close when trying to run one example but then I get

this
message I don't understand:

"This .resources file shouldn't be used with this reader. Your resource
reader type: System.Resource s.ResourceReade r, mscorlib,

Version=1.0.241 1.0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"

What does it mean?

Seems my english isn't good enough.

TIA

Kenneth P


Nov 18 '05 #3
Sure, why not,

Here's the code for the .aspx, named 16.3.2.aspx

<%@ Page Inherits="myCod eBehind_1633" Src="16.3.3.vb"
ResponseEncodin g="utf-8" %>
<html>
<head>
<title>Using Resource Files in ASP.NET</title>
</head>
<body style="FONT: x-small Verdana, Arial, sans-serif">
<form method="post" runat="server">
<b>The Current Culture is:</b>
<asp:Label id="CultureType " runat="server"> </asp:Label>
<hr />
<p>
<b>
<asp:Label id="Welcome" runat="server"> </asp:Label>
</b>
</p>
<p>
<b>
<asp:Label id="Choose" runat="server"> </asp:Label>
</b>
<asp:DropDownLi st id="EncodType" runat="server"
AutoPostBack="T rue">
<asp:ListItem Value="en-US" Text="English" />
<asp:ListItem Value="en-NZ" Text="English (New Zealand)" />
<asp:ListItem Value="fr-FR" Text="French" />
<asp:ListItem Value="de-DE" Text="German" />
<asp:ListItem Value="he-IL" Text="Hebrew" />
<asp:ListItem Value="ja-JP" Text="Japanese" />
<asp:ListItem Value="es-MX" Text="Spanish (Mexican)" />
<asp:ListItem Value="uk-UA" Text="Ukrainian (Ukraine)" />
</asp:DropDownLis t>
</p>
<asp:DataGrid id="myDataGrid " runat="server"
AutoGenerateCol umns="False" HeaderStyle-ForeColor="Whit e"
HeaderStyle-BackColor="Blac k" Font-Size="8pt" Font-Name="Verdana"
ShowFooter="fal se" BorderColor="bl ack" Width="740">
<Columns>
<asp:BoundColum n DataField="Firs tName" />
<asp:BoundColum n DataField="Last Name" />
<asp:BoundColum n DataField="Birt hDate"
DataFormatStrin g="{0:D}" />
<asp:BoundColum n DataField="Hire Date"
DataFormatStrin g="{0:D}" />
</Columns>
</asp:DataGrid>
</form>
</body>
</html>

and here's the code behind file 16.3.3.vb

Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.W ebControls
Imports System.Web.UI.H tmlControls
Imports System.Globaliz ation
Imports System.Threadin g
Imports System.Resource s
Imports System.IO

Public Class myCodeBehind_16 33 : Inherits Page

Public myDataGrid As DataGrid
Public EncodType As DropDownList
Public CultureType As Label
Public Choose As Label
Public Welcome As Label
Public rm As ResourceManager =
ResourceManager .CreateFileBase dResourceManage r("myResourceFi le",
Server.MapPath( "/resources") & Path.DirectoryS eparatorChar, Nothing)

Public Sub Page_Load(Sende r As Object, E As EventArgs)
Dim culture As CultureInfo
Dim myDataAdapter As SqlDataAdapter
Dim myDataSet As New DataSet

If Not Page.IsPostBack Then
culture = CultureInfo.Cur rentCulture
Else
culture = New CultureInfo(Enc odType.Selected Item.Value)
Thread.CurrentT hread.CurrentCu lture = culture
End If

CultureType.Tex t = culture.English Name
Welcome.Text = rm.GetString("G reeting", culture)
Choose.Text = rm.GetString("E ncMessage", culture)

myDataGrid.Colu mns(0).HeaderTe xt = rm.GetString("F irstName", culture)
myDataGrid.Colu mns(1).HeaderTe xt = rm.GetString("L astName", culture)
myDataGrid.Colu mns(2).HeaderTe xt = rm.GetString("B irthDate", culture)
myDataGrid.Colu mns(3).HeaderTe xt = rm.GetString("H ireDate", culture)

myDataAdapter = New SqlDataAdapter( "Select LastName, FirstName,
BirthDate, HireDate From Employees", _
"server=localho st;database=Nor thwind;uid=sa;p wd=ohlywohly;")
myDataAdapter.F ill(myDataSet, "Employees" )

myDataGrid.Data Source = myDataSet.Table s("Employees"). DefaultView
myDataGrid.Data Bind()
End Sub

End Class

and here's the code for the five resources files. you have to compile them
first before using them using

resgen
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.de-DE.txt
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.de-DE.resources

resgen
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.fr-FR.txt
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.fr-FR.resources

resgen
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.en-NZ.txt
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.en-NZ.resources

resgen
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.es-MX.txt
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.es-MX.resources

resgen C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.txt
C:\Inetpub\wwwr oot\Sams\TipsTr icks\C16\resour ces\myResourceF ile.resources

first 'myResourceFile .de-DE.txt'

[strings]
Greeting = Willkommen!
FirstName = Vorname
LastName = Familienname
BirthDate = Geburtsdatum
HireDate = Miete-Datum
EncMessage = Wählen Sie Ihre Verschlüsselun g:

and then no two with the name 'myResourceFile .en-NZ.txt'

[strings]
Greeting = Good Day!

and number three 'myResourceFile .es-MX.txt'

[strings]
Greeting = Bienvenido!
FirstName = Nombre de pila
LastName = Apellido
BirthDate = Fecha de Nacimiento
HireDate = Fecha de Alquiler
EncMessage = Escoja su codificación:

number four: 'myResourceFile .fr-FR.txt'

[strings]
Greeting = Accueil!
FirstName = Prénom
LastName = Nom de famille
BirthDate = Date de Naissance
HireDate = Date de Location
EncMessage = Choisissez votre codage:

and at last number 5: 'myResourceFile .txt'

[strings]
;
; lines beginning with semi-colons are treated as comments
;
; Specify a locale-specific welcome message
Greeting = Welcome!
;
; Create locale-specific header text for our DataGrid
FirstName = First Name
LastName = Last Name
BirthDate = Birth Date
HireDate = Hire Date
;
; Create locale-specific text for our Label
EncMessage = Choose your encoding:

The .resources files should be saved to a /resources directory below the
root directory.

Kenneth P.

"Joyjit Mukherjee" wrote:
Hi,

can you post us the code ?

regards
Joyjit

"Kenneth P" <Ke******@discu ssions.microsof t.com> wrote in message
news:62******** *************** ***********@mic rosoft.com...
Hi,

I have a very good book on asp.net Sams ASP.NET Tips, Tutorials and Code
ISBN 0-672-32143-2 and is trying to teach myself from examples from this

book
Chapter 16.

Anyway I come quite close when trying to run one example but then I get

this
message I don't understand:

"This .resources file shouldn't be used with this reader. Your resource
reader type: System.Resource s.ResourceReade r, mscorlib,

Version=1.0.241 1.0,
Culture=neutral , PublicKeyToken= b77a5c561934e08 9"

What does it mean?

Seems my english isn't good enough.

TIA

Kenneth P


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1724
by: Corrupted Mind | last post by:
I have just finished the K&R's book. And, I would like to know what to forget and add to the teaching of K&R? I ask this because I know that no book is perfect, nor complete. ( even if they are the guys who wrote C ) I would like to also help GNU projects, therefore I would like to know the programming style to be adopted.
1
2053
by: code | last post by:
Hi Grp http://www.books-download.com/?Book=1493-PHP+Hacks+%3a+Tips+%26+Tools+For+Creating+Dynamic+Websites+(Hacks) Description Programmers love its flexibility and speed; designers love its accessibility and convenience. When it comes to creating web sites, the PHP scripting language is truly a red-hot property. In fact, PHP is currently used on more than 19 million web sites, surpassing
1
2887
bartonc
by: bartonc | last post by:
Go to http://www.thescripts.com/forum/forum152.html to start discussions on: > how much python dictionaries are like SQL tables > how to use MySQLdb extention, including ODBC
17
23311
sashi
by: sashi | last post by:
Hi everyone, Here are some VB related tips & tricks, hope it helps. Good luck & Take care. Important This thread is closed for general posting. Please start a new thread if you have a question or comment. ADMINISTRATOR
0
1297
by: travolta006 | last post by:
Learn how to optimize and tune up your system, get rid of boring errors and uninstall unnecessary thing with very useful tips and tricks http://windowsxpsp2pro.blogspot.com
6
1614
by: travolta009 | last post by:
Learn how to optimize and tune up your system, get rid of boring errors and uninstall unnecessary thing with very useful tips and tricks http://windowsxpsp2pro.blogspot.com
0
305
by: kamalpp | last post by:
hi check http://aspnet-tips-tricks.blogspot.com/ for tips and tricks Thanks
0
1368
by: css | last post by:
http://php.apachai.com a lot of php tips & tricks
0
766
by: Dhanabal | last post by:
FREE Tutorials on HTML XHTML CSS JavaScript XML XSL ASP SQL ADO VBScript, SAP - ABAP visit ebooks.univdatabase.com
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.