如何在WindowsForms中从SqlServer检索日期到文本框 [英] How to retrieve date from SqlServer to Textbox in WindowsForms

查看:70
本文介绍了如何在WindowsForms中从SqlServer检索日期到文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据库中有datetime字段。



我想在文本框中显示日期。



如何操作。

I having datetime field in my database.

I want to display date in my text box.

How to do.

推荐答案

您将需要使用ADO.Net。如果您搜索ADO.Net,在线有很多示例。您将使用SqlConnection类以及SqlCommand和可能的SqlDataReader。如果您搜索它们,本网站上还有很多文章, http://www.codeproject。 com / search.aspx?q = ado.net + winforms [ ^ ]
You will want to use ADO.Net. There are many examples online if you search for ADO.Net. You'll use the SqlConnection class as well as the SqlCommand and likely SqlDataReader. There are also many articles on this site if you search for them, http://www.codeproject.com/search.aspx?q=ado.net+winforms[^]


这篇关于如何在WindowsForms中从SqlServer检索日期到文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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