Check Duplicates
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;
精彩评论