开发者

Check Duplicates

开发者 https://www.devze.com 2023-02-28 08:32 出处:网络
I\'m using following code which is not working to check duplicate values for \"Revision Status\" private bool CheckRevision(string docType,string Revision)

I'm using following code which is not working to check duplicate values for "Revision Status"

private bool CheckRevision(string docType,string Revision)
        {
            bool Res = false;
            DataTable DT = new DataTable();
            DT = PinDicDAO.GetRevision(docType)开发者_如何学Python;
            DataView DV = new DataView(DT);
            DV.RowFilter = "RevisionStatus='" + Revision.Replace(" ", "") + "' OR RevisionStatus='"+Revision+"'";
            if (DV.Count > 0)
                Res = true;

            return Res;
        }

format of the RevisionStatus will be like

CN - Cancelled
IFP - Issued For Purchase


Try to check the datatable instead.

if (DT.Rows.Count > 0)
                Res = true;

            return Res;
0

精彩评论

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