473,799 Members | 3,084 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DateTime formatting, Web App, Web Service, SQL Server

Hi,

I have a column DateTime in a table in MS SQL Server database. I take
this column using a Web Service and show it in a TextBox in a Web
Application. I want the format of the date to be
"dd\mm\yyyy hh:mm:ss". The collation name of the database is
SQL_Latin1_Gene ral_CP1_CI_AS (if it necessary I could change it).
In the Web service and in the Web App I don't change anything about
culture and the text box shows "mm/dd/yyyy hh:mm:ss AM/PM" .

I use a DataSet to get the data from the database (fill it with
SqlDataAdapter) .

What could I do to fix this problem?

Thanks.

Nov 17 '05 #1
2 1782
I always use dd MMM yyyy as the date when passing it around servers, then
when it comes to display it, change it how you like.

Culture settings cause no end of problems (even when it seems like the
culture settings are correct for what you want) when using dd/mm/yyyy which
is ambigious with mm/dd/yyyy when it comes to things like 10/03/2005.
"Iwan Petrow" <xx****@abv.b g> wrote in message
news:11******** *************@l 41g2000cwc.goog legroups.com...
Hi,

I have a column DateTime in a table in MS SQL Server database. I take
this column using a Web Service and show it in a TextBox in a Web
Application. I want the format of the date to be
"dd\mm\yyyy hh:mm:ss". The collation name of the database is
SQL_Latin1_Gene ral_CP1_CI_AS (if it necessary I could change it).
In the Web service and in the Web App I don't change anything about
culture and the text box shows "mm/dd/yyyy hh:mm:ss AM/PM" .

I use a DataSet to get the data from the database (fill it with
SqlDataAdapter) .

What could I do to fix this problem?

Thanks.

Nov 17 '05 #2
Hi,

Use it as a DateTime all the time, in this way you will not care about the
different representations , at the web server, when you need to convert it
to string use DateTime.ToStri ng( string format) to format it as needed,
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Iwan Petrow" <xx****@abv.b g> wrote in message
news:11******** *************@l 41g2000cwc.goog legroups.com...
Hi,

I have a column DateTime in a table in MS SQL Server database. I take
this column using a Web Service and show it in a TextBox in a Web
Application. I want the format of the date to be
"dd\mm\yyyy hh:mm:ss". The collation name of the database is
SQL_Latin1_Gene ral_CP1_CI_AS (if it necessary I could change it).
In the Web service and in the Web App I don't change anything about
culture and the text box shows "mm/dd/yyyy hh:mm:ss AM/PM" .

I use a DataSet to get the data from the database (fill it with
SqlDataAdapter) .

What could I do to fix this problem?

Thanks.

Nov 17 '05 #3

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

Similar topics

0
5163
by: Symon R | last post by:
This is a bit of a weird one that I haven't yet been able to solve - I'm hoping someone out there can disprove my findings and tell me where I've gone wrong! I have designed a web service that accepts messages from .NET clients. The web method call includes an object as one of it's parameters - this reflected object has been given a property called "FutureDelivery" and expects a DateTime value. The clients may be in different timezones...
6
1818
by: Carl | last post by:
Hi, to be use with SQL server database 1- From window form textbox object From this assignement, txtTOTAL.Text="0.00m"; How do you convert back to decimal type ? How do you assign a default datetime value to it ? How do you convert back the text enter by user into datetime ?
15
14289
by: Fritz Switzer | last post by:
I'd like to have a string assigned the value of a DateTime.AddMinutes(amount) so that the string is formatted in "HH:MM" format. For example: DateTime.Now.AddMinutes(30) returns "00:30" DateTime.Now.AddMinutes(90) returns "1:30" or "01:30"
5
7263
by: Iwan Petrow | last post by:
Hi, I have Win application -> Web service -> Sql Server. The user input date and time in format dd/MM/yy hh:mm. I convert it to datetime and send it to a web service which save it to the db. But the datetime is changed according the timezone of the server and the client machine (I think). What can I do that the date to stay the same (I want to send datetime type and I don't want to change windows setting of the server and the client...
1
7939
by: M DL via .NET 247 | last post by:
Hi all, i have one problem with a method of an xml web service that use a datetime data type input variable, and may be all is caused by international settings. The XML web service (localized in italy, with italian settings) have the following method: MYXWS.MyMethod(input_var as datetime) On my dev machine (localized in italy, with italian settings) i have created a web application that use the proxy class for call the XML wer...
2
3335
by: bryars | last post by:
I want to write some SQL which results in an automatic conversion of a datetime to a string in a format suitable for the Language of the connection (either by explicitly setting the Language in the connection string, or by setting the default language in for the user used for the connection.) The casting from string to datetime uses the language setting: Data Source=localhost\sqlexpress;Initial Catalog=master;Persist Security...
3
30842
by: Tim | last post by:
Folks, I'm trying to format a print string so that it reports progress whilst processing a looping structure with a date time stamp appended to the end of the string. This started out life as a simple need to create a display that show progress to users when updating large tables in a data warehouse in real time. I have subsequently address that need through a different method, however I am challenged by the seeming impossibility to...
0
16512
yasirmturk
by: yasirmturk | last post by:
Standard Date and Time Functions The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all. They are simple, easy, and brief and you should use them any time you need to incorporate any date literals or date math in your T-SQL code. create function DateOnly(@DateTime DateTime) -- Returns @DateTime...
0
9685
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
10249
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10219
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
7563
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
5461
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4138
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
3755
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2937
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.