When my select command does not have any result, it throws an exception. Instead I want to continue with the process without exception. How to control this by checking whether there is data retrieved from the select statement?
Here is my query:
sqlid = new SqlCommand("SELECT TOP 1 Proj_id FROM Proj_details WHERE Front_end = '" + strfrontend + "'ORDER BY Date_time desc", con);
id = sqlid.ExecuteScalar().ToString();