C#中的动态搜索 [英] dynamic search in c#

查看:104
本文介绍了C#中的动态搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
如何在C#2010中动态搜索?
我想动态搜索数据库,以便在form.data上的dataGridview中显示结果.请帮助.
感谢

Hello
how to dynamic search in c# 2010?
i want to search in DB dynamically so that show the results in the dataGridview on form.please help.
thanks

推荐答案

这是一个很好的教程,展示了如何使用DataGridView从SQL DB检索和显示数据:
http://www.dotnetperls.com/sqldataadapter [ http://www.dotnetperls.com/datagridview [
我建议您每隔1秒使用一次系统计时器,并在计时器溢出时使用:
1.从数据库检索所有数据
2.从DataGridView中删除所有内容
3.在
Here is a good tutorial that shows how to use DataGridView to retrieve and display data from an SQL DB:
http://www.dotnetperls.com/sqldataadapter[^]

Here is another tutorial on DataGridViewin general:
http://www.dotnetperls.com/datagridview[^]

When you say "dynamically" i take it you mean that you want it to appear to "refresh" or "update" to reflect changes without the user''s intervention.

I would suggest you use a system timer at a 1 second interval, and on timer overflow:
1. retrieve all data from the DB
2. remove all content from the DataGridView
3. write new contents in


这篇关于C#中的动态搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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