代码将数据库中的字段与txt文件进行比较 [英] code compare a field in the database with the txt file
问题描述
我们如何将数据库中的字段与vb.net中的txt文件进行比较
How do we compare a field in the database with the txt file in vb.net
推荐答案
您好,
如果要将文本文件数据与数据库"字段值进行比较,请执行以下操作:
首先,从文本文件中读取值并将其存储在变量中(例如:
Hi,
if you want to compare the text file data with Database field value, then do the following things:
first of all, read the value from text file and store it in a variable (Say:
sTextFileData
),为此请参见以下链接:
http://www.freevbcode.com/ShowCode.asp?ID=4492 [ ^ ]
http://www.techrepublic.com/article/使用visual-basic-net/1045309读取和写入文本文件 [
), for this see following links:
http://www.freevbcode.com/ShowCode.asp?ID=4492[^]
http://www.techrepublic.com/article/read-and-write-text-files-with-visual-basic-net/1045309[^]
Now fetch the data of that field from database,
to do this see the following link and store the data in a variable (Say
sSQLData
)
http://www.startvbdotnet.com/ado/sqlserver.aspx [
)
http://www.startvbdotnet.com/ado/sqlserver.aspx[^]
Now simply, compare the two variables:
sTextFileData
和
and
sSQLData
这篇关于代码将数据库中的字段与txt文件进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!