Solved

Date field trouble in asp.net with Oracle sqldatasource

Posted on 2007-04-01
6
875 Views
Last Modified: 2008-01-09
Hi,
I have some trouble working with date in asp.net and visual studio 2005.
I use a development environment at home with an oracle 8i server and iis5 from windows 2000 server
I create a page that use a sqldatasource to query the oracle database and to update
a row in the timesheet table.
I use the gridview to do so with an update command, the date field in the EditItemTemplate of my gridview is defined like this:
<EditItemTemplate>
 <asp:TextBox Width="60px" ID="TextBox1" runat="server" Font-Size="8pt" Text='<%# Bind("FORDATE", "{0:dd-MMM-yy}") %>'></asp:TextBox>
</EditItemTemplate>

All update are succefull and I well see the date like 01-mar-07 (The Oracle database need to receive date format in dd-MMM-yy to accept modification)

The strange thing is when I upload my work on the production server at the office, when I try to do the same update with the gridview, an error occured because the date displayed in my aspx page is not any more 01-mar-07 but 01-mars-07 (looks like french/belgium format).
If I rewrite the date field in 01-mar-07, the update is going ok; but if I leave it like displayed ->error 'not a valid month'

Would it be possible I need to change something on the IIS server at my office ?
or in the web.config ?

Thanks for your help
0
Comment
Question by:talentium
  • 2
  • 2
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
levyuk earned 200 total points
ID: 18831540
You should check the culture setting for the page/application/IIS and check that it is in english
0
 
LVL 27

Assisted Solution

by:sujith80
sujith80 earned 50 total points
ID: 18834241
dd-MMM-yy - is not a correct date format picture.

In order to get date in 01-mar-07 format: you should use dd-mon-yy picture
0
 

Author Comment

by:talentium
ID: 18835024
I first try the culture settings on the IIS and get rid of my problem,
indeed the encoding was not the same on each server.

But as I am not an expert, I am also interested by sujith80 comment, actually
I use dd-MMM-yy and it works lika a charm, should I change to dd-mon-yy ?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Expert Comment

by:levyuk
ID: 18837514
To be honest talentium I've never seen dd-mon-yy in asp.net, i think it's to do with oracle not ASP.net so you wouldn't need it in your page, I would stick with what you know and what works
0
 
LVL 27

Expert Comment

by:sujith80
ID: 18841504
Sorry for the confusion,

dd-mon-yy - is a date format picture in Oracle. I am not sure about ASP.
0
 

Author Comment

by:talentium
ID: 18842049
thanks for your help
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now