将char数据类型转换为datetime数据类型 [英] The Conversion of a char data type to a datetime data type
本文介绍了将char数据类型转换为datetime数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在转换vb.net 2005中的一个应用程序。创建了一个新表单和一个文本框。输入值textbox1.text = Format(now(),"dd / mm / yyyy")。我在文本框中有当前日期,并在日期更改为17/03/2007。当我将其插入数据库。我收到了错误。 "将char数据类型转换为日期时间数据类型会导致超出范围的日期时间值。该语句已被终止。
I am converting an applicationin vb.net 2005. Created a new form and one text box. Enter the value textbox1.text = Format(now(), "dd/mm/yyyy"). I Have got current date in the text box and change it with date like 17/03/2007. When i insert it to the database. I got the error. " The conversion of char data type to a datetime data type resulted in an out-of-range date time value. The statement have been terminated.
任何正文都可以帮助我解决问题。
Can any body help me to solve the problem.
谢谢
推荐答案
textbox1.text = Format(now()," dd / mm / yyyy")
您在文本框中插入时间。如何在db中插入文本框值。你有没有将textbox1.text转换成数据时格式?你可以显示你的代码,用于在db中插入文本框值吗?
这篇关于将char数据类型转换为datetime数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文