時折、AD からの検索で、System.Byte[] の応答が得られます。vs2010 でソース ページ ファイルを開いて再保存すると、問題なく検索結果が返されます。
注: 結果セットを xml にバインドしています。これには大いに関係があるのではないかと想像しています。
コードの抜粋を次に示します。
public void bindGridView(string sortExp, string sortOrder)
{
DataSet aDataSet = new DataSet();
XmlDocument xd = LDAPConn(sortExp, sortOrder);
aDataSet.ReadXml(new StringReader(xd.InnerXml));
// Bind the DataSet to the grid view
DataView dv = new DataView();
string sortMsg = "";
switch (sortExp)
{
case "sn":
sortMsg = "Lastname";
break;
case "department":
sortMsg = "Department";
break;
case "Title":
sortMsg = "Title";
break;
case "physicalDeliveryOfficeName":
sortMsg = "Store";
break;
default:
sortMsg = sortExp;
break;
}
if (aDataSet.Tables.Count > 0)
{
try
{
debug(true, "<h2 style='float:right;'><b>Sorting By:</b><strong style='color:#880000;'>" + sortMsg + "</strong> & <b>Direction:</b><strong style='color:#880000;'>" + sortOrder.ToString() + "</strong></h2>");
dv = aDataSet.Tables[0].DefaultView;
GridView1.DataSource = dv;
GridView1.DataBind();
}
catch (Exception e)
{
debug(true, "<br/><b style='color: rgb(255,0,0);'>Your search returned no results.</b><br/><span style=''>" + e.Message + "<br/>" + e.InnerException + e.Source + "</span>");
}
}
}