开发者

The name patientid does not exist in the current context

开发者 https://www.devze.com 2023-04-04 21:11 出处:网络
Hi I get this error message \"the name patientid does not exist in the current context\" and also, \"the name formpatientid does not exist in the current context\". Why would this be occuring?

Hi I get this error message "the name patientid does not exist in the current context" and also, "the name formpatientid does not exist in the current context". Why would this be occuring?

    public void patientUpdate()
    {
        hospitalSQLEntities db = new hospitalSQLEntities();
        string formpatiendid = Request.Para开发者_Python百科ms["patientid"];
        patient mypatient = null;
        try
        {
            mypatient = db.patients.Single(u => **patientid.Equals(formpatientid))**;
        }


Does this fix the issue?

   public void patientUpdate()
    {
        hospitalSQLEntities db = new hospitalSQLEntities();
        string formpatientid = Request.Params["patientid"];
        patient mypatient = null;
        try
        {
            mypatient = db.patients.Single(u =>
                u.patientid.Equals(formpatientid));
        }

I also not use the try block. It's bad practice to just trap everything.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号