如何验证记录是否已存在于数据库或列表视图Windows中 [英] How to validate if records is already exist in dataBase or in listview windowsApplication

查看:73
本文介绍了如何验证记录是否已存在于数据库或列表视图Windows中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

美好的一天,任何人都可以教给我一个如何给我一个提示,即如何跟踪列表视图中是否有记录.我目前在Vb.net 2008 Windows应用程序中使用列表视图,并且目前使用的For Loop可以读取其中的所有记录. listview验证记录是否在listview中,但是我的问题是if records
在列表视图中已存在此记录
例如:样品记录",到样品记录"
我的验证码未跟踪此样本记录"
或从技术上讲,它们无法跟踪CAPITAL CHARACTER与Normal CHARACTER的相似性:(感谢所有编码人员在这里:D

good Day can any one teach me how give me a tip how to trace if records is already in the in listview , i currently use listview in Vb.net 2008 Windows Application and i currently use a For Loop that reads all Records in listview to validate if the records is in the listview , but my problem is if records
is in the the listview is already Exist this Records
for Ex:" SAMPLE RECORD" , to "Sample Record"
my validation code not trace this one "Sample Record"
or technically speaking they not trace the similarity of CAPITAL CHARACTER to Normal CHARACTER :( Thanks to all Coders Here :D

推荐答案

如果您的问题是在检查等效字符串时不考虑大小写,然后比较转换为大写的两个字符串.
If your problem is checking equivalent strings without regard to case, then compare both strings converted to upper case.


为进行比较,您不需要使用For循环,请将DataView.RowFilter(string)与比较值一起使用,并使用DataView.Count ()检查是否存在匹配项.

http://msdn.microsoft.com/en-us/library/system. data.dataview.rowfilter.aspx [ ^ ]

希望对您有所帮助.
For comparison you do not need to use a For loop, use DataView.RowFilter(string) with the comparison value and use DataView.Count() to check if there is a match or not.

http://msdn.microsoft.com/en-us/library/system.data.dataview.rowfilter.aspx[^]

hope it helps.


这篇关于如何验证记录是否已存在于数据库或列表视图Windows中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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