Forum
 
ForumForumDiscussions and...Discussions and....Net framework ....Net framework ...FormView/GridView/ObjectDataSource insist on en-US cultureFormView/GridView/ObjectDataSource insist on en-US culture
Previous Previous
 
Next Next
New Post
 18/01/2009 17:56
 

Richard - I tried your tip on setting the culture but the FormView/GridView/ObjectDataSource are insisting on a US format for my data.

It seems it's the ObjectDataSource that's the culprit and it actually uses the InvariantCulture - which is still useless. https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=105015 

However - if you throw an entry into the parameters collection it magically does the right thing.  Here's one for a date.

     <UpdateParameters>
        <asp:Parameter Name="RegistrationDate" Type="DateTime" />
    </UpdateParameters>

I found that the same technique works for insert parameters too.  You do not need a full set of parameter entries, only put them in for the parameters that are giving you grief.  Of course the word parameter might need to be taken with salt.  If you are passing a business object then you need the name of the property that is giving you trouble.

I find it easier to do this in source view, but I think the Parameter Collection Editor | Show Advanced  Properties might be able to do it (anyone?).


Cheers,
- Richard
If this post helped you over a problem, or taught you something new, please login and rate it. Ratings are in the drop down in the top left corner
Previous Previous
 
Next Next
ForumForumDiscussions and...Discussions and....Net framework ....Net framework ...FormView/GridView/ObjectDataSource insist on en-US cultureFormView/GridView/ObjectDataSource insist on en-US culture

Forum Usage Guidelines

The forums are a place for all to exchange ideas and techniques, and to post and answer questions.  All are welcome to read, registration is required to post. 

If you learn somthing new, discover or acquire a new technique, then please take a moment to register and rate the post that just helped you.  This site does not send spam and it does not release your personal details.  Full details in the site privacy policy.

We have some simple posting guidelines to keep the forums a pleasant and informative environment.

  • No flames, no trolls
  • No profanity, no racism
  • Site management has the final word on approving or removing any thread, post, or comment
  • English language only please

 

Copyright 2002-15 by Dynamisys Ltd