如何在asp.net中获取按日期选择的数据库 [英] how to fetch database selecting by date in asp.net

查看:77
本文介绍了如何在asp.net中获取按日期选择的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中获取按日期选择的数据库

how to fetch database selecting by date in asp.net

推荐答案

在storageprocedure中检索数据,getdate()将返回当前日期
Retrieve data in storedprocedure,getdate() will return current date
Select * from tablename where Date=getdate()




如果您的日期列的数据类型为DateTime



or
if your date column is of datatype DateTime

Select * from tablename where Date='2011-12-09'




尝试使用提供的ASP.NET DataSource控件.例如 SqlDataSource [
Hi,

Try using provided ASP.NET DataSource controls. For example SqlDataSource[^]. It supports parameters and ih has intuitive designer. There is so much examples for this topic on net. Just google... :)


这篇关于如何在asp.net中获取按日期选择的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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