简体   繁体   English

在C#中从数据库中检索记录

[英]Retrieving records from Database in C#

I have a database connected to my program, I want to search this database records looking for a value entered by user previously in a text box. 我有一个数据库连接到我的程序,我想搜索此数据库记录,寻找用户先前在文本框中输入的值。 Any one have an idea how to search the whole database for that value. 任何人都知道如何在整个数据库中搜索该值。

Any help is appreciated! 任何帮助表示赞赏! Thanks! 谢谢!

If you are looking to search the entire database tables for a specific piece of text then follow the guide here; 如果您要在整个数据库表中搜索特定的文本,请按照此处的指南进行操作;

Sql Server text search across all tables 跨所有表的Sql Server文本搜索

Two simple steps. 两个简单的步骤。

  1. Get the value from the text box (depends on the language you are using) 从文本框中获取值(取决于您使用的语言)
  2. Execute a select query on the database using the value from the text box as a parameter in the where clause of the query. 使用文本框中的值作为查询的where子句中的参数,对数据库执行select查询。

However - you need to clarify the question a lot more in order to get a more sensible answer. 但是 - 为了获得更明智的答案,你需要更多地澄清这个问题。

What languages are you using? 你用的是哪种语言?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM