正在阅读的数据中仍有"
,即使我放了HttpUtility.HtmlDecode()
功能我该如何解决这个问题?图片如下
和代码如下所示
string quer = "SELECT Date_Issued, quantity, Unit from Issuance_Consumables where Model = '"+ HttpUtility.HtmlDecode(model.ToUpper())+"' AND Branch = '"+ branch.ToUpper()+"' AND Dept = '"+ dept.ToUpper()+"' AND Company = '"+company.ToUpper()+"' AND BU = '"+ bu.ToUpper()+"' AND Section = '"+section.ToUpper()+"'";
try
{
connUs.Open();
reads.CommandText = quer;
readers = reads.ExecuteReader();
}
catch(System.Exception)
{
//
}
while(readers.Read())
{
dateissue = readers.GetDateTime(0).ToShortDateString();
quantity = readers.GetDecimal(1).ToString();
unit = readers.GetString(2);
}
gvModal.Rows[y].Cells[9].Text = dateissue;
gvModal.Rows[y].Cells[10].Text = quantity;
gvModal.Rows[y].Cells[11].Text = unit;