开发者

The name patientid does not exist in the current context

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜