C# 自动完成服务方法中的问题
我已经写了以下几行代码C# 自动完成服务方法中的问题,c#,asp.net,c#-4.0,C#,Asp.net,C# 4.0,我已经写了以下几行代码 [System.Web.Script.Services.ScriptMethod()] [System.Web.Services.WebMethod] public static List<string> GetNames(string prefixText) { OrganisationManger OrgManager = new OrganisationManger(); Table<Organisation> ResultS
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetNames(string prefixText)
{
OrganisationManger OrgManager = new OrganisationManger();
Table<Organisation> ResultSet = OrgManager.GetOrganisationWithSameName(prefixText);
List<string> Names = new List<string>();
for (int i = 0; i < ResultSet.Count; i++)
{
Names.Add(ResultSet.Rows[i][1].ToString());
}
return Names;
}
此行ResultSet.Rows[i][1].ToString不起作用。谁能告诉我如何在ResultSet的迭代中获取名称
实际上,我正在尝试在自动完成文本框中获取姓名列表…您能定义为不工作吗?你有错误吗?如果是,那又怎样?每当我看到索引和for循环时,我也会看到indexoutfrange异常。我们需要更多信息,了解它的'not working'Error 1958'DataModals.Table'不包含'Rows'的定义,并且找不到接受'DataModals.Table'类型的第一个参数的扩展方法'Rows'。是否缺少using指令或程序集参考?E:\TFS\1FourCommunity\14Muslims.Web\14Muslims.Web\REGISTRATION\regorganizationedit.aspx.cs 1067 33 14Muslims.Web