This means ds.Tables[0] doesn't contains any rows. Check whether the row exists or not before using it.
Try this:
if(ds.Tables[0].Rows.Count > 0){
Msg.Body = "Hi, <br />Please check your Login Detailss<br /><br />Your Username: " + ds.Tables[0].Rows[0]["PrimaryEmail"] + "<br /><br />Your Password: " + ds.Tables[0].Rows[0]["Password"] + "<br /><br />";
}
--Amit