You need not to use parameterized query since your query already contains values. so make your query as follows and then run it.
conn.Open();
string inputQuery= "select count(*) from userdata where FirstName='" + TextBoxFN.Text + "' And LastName='" + TextBoxFN.Text +"'";
SqlCommand com = New SqlCommand(inputQuery, conn);
temp = Convert.ToInt32(com.ExecuteScalar().ToString());
if (temp >= 1) '<--- updated here
{
Label1.Text = "Student Already Exist";
}
or else you can use parameterized query as :
string check = "select count(*) from userdata where FirstName='{FN}' AND LastName='{LN}'"
SqlCommand com = new SqlCommand(check, conn);
com.Parameters.AddWithValue("@FN", TextBoxFN.Text);
com.Parameters.AddWithValue("@LN", TextBoxLN.Text);
temp = Convert.ToInt32(com.ExecuteScalar().ToString());