in my program i need to check if a record in the database already exists in the table using the if statement.
using c# i am trying to do this through an sql con
You should be using ExecuteScalar for cheking if the record exists. ExecuteNonQuery runs a transact-SQL statement against the connection and returns the number of rows affected for an UPDATE, INSERT, or DELETE. It doesn't apply for SELECT statements