Using VB.Net and SQL Server
I want to compare the textbox value with table row value by using if condition
Code
If textbox1.text = cmd
cmd = New SqlCommand("Select name from table1", con) Then
cmd.ExecuteNonQuery()
cmd = SqlCommand
The above code is showing error in if condition. I don’t know how to compare the textbox value with table row value by using if condition.
What is the proper way to use if condition.
It seems like you’re trying to compare a textbox to a database value. You need to retrieve the value from the database first.
Edit If you want to match against multiple names, it’s probably best to put it as a sql query