如何将文本框内容转换为DATE? [英] How to convert text box content to DATE?
本文介绍了如何将文本框内容转换为DATE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在数据库表中使用 DATE
数据类型并试图在VB.net前端。
如何将字符串内容从字符串转换为日期?
Hi,
I am using DATE
data type in a database table and trying to use that in VB.net front end.
How we can Convert text box content from string to date?
推荐答案
将textBox1.Text
转换为DateTime
:
Hi,
ConverttextBox1.Text
to aDateTime
:
Dim dateToInsertInDatabase As DateTime = Convert.ToDateTime(textBox1.Text)
然后,您可以将 DateTime
插入数据库:
http://social.msdn .microsoft.com /论坛/英国/ vbgeneral / thread / d11ed406-d9bf-4363-84b6-99f4e9ee4631 [ ^ ]
Then, you can insert the DateTime
into your database:
http://social.msdn.microsoft.com/Forums/uk/vbgeneral/thread/d11ed406-d9bf-4363-84b6-99f4e9ee4631[^]
这篇关于如何将文本框内容转换为DATE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文