Just add () right now you are checking if user have given email OR (have login and password), so right now when you enter email and password correctly system will not permit you to login.
string str = "select login_with_email from PROFILE where (email_id='" + txt_login_userid.Text.Trim() + "' OR user_name ='" + txt_login_userid.Text.Trim() + "') and password= ' " + txt_login_pass.Text.Trim()+'" " ;
But seriously I don't want to start pointing how many things is wrong with this. Use sql parameters at least.