隐式转换类型字符串到日期时间 [英] Implicit convert type string to date time

查看:68
本文介绍了隐式转换类型字符串到日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在grideview rowupdating上执行操作时遇到错误



I got error when try to perform operation on grideview rowupdating

Convert.ToDateTime(((TextBox)(grdBookDetails.Rows[e.RowIndex]
.FindControl("TextBox1")))
.ToString());





请给我suggetion



Please give me suggetion

推荐答案

取决于全球化 [ ^ ],字符串日期格式可能有所不同。



您应该使用 DateTime.TryParse(String,IFormatProvider,DateTimeStyles,DateTime) [ ^ ]方法。点击链接查找示例。
Depending on Globalization[^], the string format of date may differ.

You should use DateTime.TryParse(String, IFormatProvider, DateTimeStyles, DateTime)[^] method. Follow the link to find an example.


这篇关于隐式转换类型字符串到日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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