如何将在文本框中输入的文本与表格中的字段匹配? [英] How to match the text entered in a textbox with a field in a table?
本文介绍了如何将在文本框中输入的文本与表格中的字段匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在网络表单中有一个文本框.我必须检查在该文本框中输入的文本是否与表格中的字段相同,该怎么办?
I have one textbox in a webform. I have to check if the text entered in that textbox is same as in the field in a table, how can I do that?
推荐答案
您不能只比较两者吗字符串(插入文本框中的一个和从表中读取的一个)?
您指的是哪种桌子"?
:)
Cannot you just compare the two strings (the one inserted in the text box and the one read from the table)?
What kind of ''table'' are you referring to?
:)
如果按表表示数据库表,那么答案显然是SQL.从myTable中选择count(*),其中myfield =''mytext''
当然,您应该在数据层中执行此操作,而不是通过字符串混搭来构建SQL.
If by table you mean database table, the answer is obviously SQL. select count(*) from myTable where myfield=''mytext''
Of course, you should do this in your data layer and not build your SQL by string mashing.
这篇关于如何将在文本框中输入的文本与表格中的字段匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文