使用ASP.Net在TextBox中显示DateTime值 [英] Display DateTime value in TextBox using ASP.Net

查看:325
本文介绍了使用ASP.Net在TextBox中显示DateTime值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

cmd.Parameters.Add("@ DateIssue",SqlDbType.DateTime).Value = TextBoxDIssue.Text;

TextBoxDIssue.Text = dr ["DateIssue"].ToString();



大家好!

我正在使用以上两个语句在文本框中显示日期时间值.我收到以下错误消息.


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

cmd.Parameters.Add("@DateIssue", SqlDbType.DateTime).Value = TextBoxDIssue.Text;

TextBoxDIssue.Text = dr["DateIssue"].ToString();



Hi folks!

I am using the above two statements to display datetime value in textbox. I am getting the following error message.


String was not recognized as a valid DateTime.

推荐答案

尝试cmd.Parameters.Add("@DateIssue", SqlDbType.DateTime).Value = Convert.ToDateTime(TextBoxDIssue.Text);


这篇关于使用ASP.Net在TextBox中显示DateTime值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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