gridview中的日期时间给出其他语言的错误 [英] datetime in gridview gives error in other languages

查看:90
本文介绍了gridview中的日期时间给出其他语言的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

我有一个文本框,在其中输入日期日期和日期,并以此绑定网格视图.但是当我选择德语或法语时,日期时间给我错误,在英语中它可以正常工作...

错误:
无法将字符串识别为有效的DateTime.

说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.异常详细信息:System.FormatException:无法将字符串识别为有效的DateTime.

Hi friends

I have a textbox in which i am taking the to and from date entry and using that i am binding the grid view . But the date time is giving me error when i am choosing german or french language , in english it works fine ......

Error :
String was not recognized as a valid DateTime.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: String was not recognized as a valid DateTime.

推荐答案

Hi,

在德语中,日期格式为"dd.MM.yyyy",在英语中,日期格式为"dd/MM/yyyy".当系统使用德语时,将日期转换为dd.MM.yyyy格式.
Hi,

In german language date format is "dd.MM.yyyy" in English language it is like this "dd/MM/yyyy" . When your system is in german language convert date to dd.MM.yyyy format.


这篇关于gridview中的日期时间给出其他语言的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆