473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dataset.WriteXML and Thread.CurrentThread.CurrentCulture

Hi

I am trying to write data back to the client using dataset.WriteXML and I
have set the Thread.CurrentThread.CurrentCulture to "no" (norwegian) just
before writing the data using WriteXML.
But dataset.WriteXML dosent seems to be using the CurrentCulture settings
and still writes dates, numeric values using the original settings.

My Code...

'Get the standard request/response objects from the current request
context
objHTTPRequest = context.Request
objHTTPResponse = context.Response
'Set the Thread-culture
Try
If objHTTPRequest.UserLanguages.Length > 0 Then
Thread.CurrentThread.CurrentCulture =
CultureInfo.CreateSpecificCulture(objHTTPRequest.U serLanguages(0))
End If
Catch ex As Exception
'Do nothing if CreateSpecificCulture fails
End Try

'Get the dataset
BuildDataSet(dsDataSet, objSQLParameters, strSPName, strConn,
intParameterCount)

'Start writing back the response as an XML
With objHTTPResponse
.ContentType = "text/xml"
dsDataSet.WriteXml(.OutputStream)
End With

Please advice.

Thanks
rahul


Nov 11 '05 #1
1 2327
Rahul Agarwal wrote:
I am trying to write data back to the client using dataset.WriteXML and I
have set the Thread.CurrentThread.CurrentCulture to "no" (norwegian) just
before writing the data using WriteXML.
But dataset.WriteXML dosent seems to be using the CurrentCulture settings
and still writes dates, numeric values using the original settings.


Well, XML is usually culture-agnostic beast, it's pure data and if you need to
style it somehow (e.g. format dates and currency values) consider using XSLT
or another tool.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

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

Similar topics

1
by: Andrés Giraldo | last post by:
Hi! I'm showing decimal values in a datagrid, but the decimal point shown is the "," and the correct is the ".". The datagrid is filled with a dataset, the dataset is filled with a SQL Server...
4
by: Eric | last post by:
Hi, can anyone guide me throught this: In my application, I have a global DataSet. I then run FTP processes in up to 10 simultaneous threads and each thread calls progress events in the main...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
1
by: Manu | last post by:
I have created a new culture : Dim objCulture As New CultureInfo("he") //hebrew When I tried to assign it to the current thread. Thread.CurrentThread.CurrentCulture = objCulture...
3
by: MAG | last post by:
Hello, I hope if anybody could help me in this situation: I have a Dataset that I fill using some sort of Business Objects Class from Oracle 8i (using OLEDB NOT ORACLE Client) and there is None...
5
by: Tsair | last post by:
I set the thread culture in MAIN() as below in order to show the date in format DAY/MONTH/YEAR, but the datagridview alway show the date in M/d/yyyy. How to set the default Date format from...
4
by: Rainer Queck | last post by:
Hi NG, in my application a <myDataTable>.Select fails with "Syntax error in the expression." It took me a while, isolate the cause to this: To select some datarows from a data table I am...
3
by: hauschild | last post by:
Guys, I am looping thru a dataset and need to update rows' columns based on the ColumnName value. I get this far but I'm unsure of how to update that actual columns value with the new value. ...
2
by: tamirmalas | last post by:
Hi, iam trying to set a culture info different than the current culture info on the system, the code compiles fine, but nothing happens, and the system culture is the one used for the program. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.