Click here to Skip to main content
15,557,965 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi guys, as for my recent question, i think this would be a more specific one:
how can i check using vb.net(only, as i am a beginner and do not understand other programming languages) if there is an existent value in a column of an access database?

Ive tried searching but the answers are only available using other languages and, as ive said, i am a beginner. I mean i can get the logic but i dont have enough knowledge to translate them into vb.net.

guys, help me please!!!
Posted

Write a select query like below
SQL
SELECT * FROM [TableName] WHERE [ColumnName]='ColumnValue'

Use ExecuteReader or ExecuteScalar of OLEDBCommand object to check the data exists or not
Here check this thread Checking Record Already exist or not[^]

For Code conversion(C# to VB.NET or etc.,), check this blog post.
.NET Code Conversion - Convert your code[^]
 
Share this answer
 
Comments
kimsnap 2-Mar-12 3:32am    
Thank you.. it worked :)
VB
Dim dataImSearchingFor as String = "What I want to Find"
Dim expressionString as String = "ColumnName LIKE '" & dataImSearchingFor & "'"

Dim DR() as DataRow = dataForm.DataSet.Database.Select(expressionString)

if DR.Length > 0
 ''' Items Found!!
End if
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900