protected string getEmailAddr()
{
SqlConnection conGet = new SqlConnection(ConfigurationManager.ConnectionStrings["connMSJ"].ConnectionString);
SqlCommand cmdGet = new SqlCommand("SELECT Email FROM Member WHERE Username=@username", conGet);
cmdGet.Parameters.AddWithValue("@username", strUsername);
conGet.Open();
SqlDataReader dtrGet = cmdGet.ExecuteReader();
if (dtrGet.Read())
return dtrGet[0].ToString();
else
return null;
dtrGet.Close();
conGet.Close();
}
dtrGet.Close();
Occured the Unreachable Code Detected with Green Colour Underline.
How can i avoid this happen even though there is no problem for me to continue execute my webpage,
But it just seem not nice in the code behind. :P