我想在日历中单击日期时在网格视图中查看数据库 [英] i want to see the database in grid view on clicking date in the calender

查看:84
本文介绍了我想在日历中单击日期时在网格视图中查看数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在default.aspx中添加了一个文本框,按钮,日历和网格视图.如果单击按钮,它将显示日历,当我单击日历中的日期时,该日期将显示在文本框中.现在数据库位于oracle中,它具有表cgl2的字段创建.creation字段保存所有条目的日期.

当日期显示在文本框中时,它将在网格视图中显示该日期的所有条目.

解决方案

hai,


在OnTextChanged事件上调用函数getdata()


在getdata函数中

  dim  s  as  字符串 = " &表中选择* textbox1.text& " 

 dim  dt  as   datable
' 执行查询并将数据存储在数据表中

gridview.datasource = dt
gridview.databind 



[edit] pre标签已添加-amit [/edit]


hi
i add a textbox,button,calender and grid view in default.aspx.if i click the button it display the calender and when i click the date in calender,the date will show in the text box.now the database is in the oracle,and it has the field creation of table cgl2.The creation field saves the date of the all entries.

When the date is show in the text box,it will show the all entries of that date in grid view.

解决方案

hai,


on OnTextChanged event call the function getdata()


in getdata function

dim s as string ="select * from table where date='" & textbox1.text &"'"

dim dt as new datable
'execute query and store the data  in datatable

gridview.datasource=dt
gridview.databind



[edit]pre tag added - amit[/edit]


这篇关于我想在日历中单击日期时在网格视图中查看数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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