public string[] GetString(string prefixText, int count){ System.Collections.Generic.List list = new System.Collections.Generic.List(count); System.Data.DataSet ds = new System.Data.DataSet(); //这里是我在数据库中取数据的代码 其中SqlHelper类是项目中的取数据基类 //string strSql = string.Format("SELECT TOP {0} NAME FROM CengWei WHERE NAME LIKE '{1}%' ORDER BY NAME",count,prefixText); //ds = SqlHelper.Query(strSql); //for (int i = 0; i //{ // list.Add(ds.Tables[0].Rows[i][0].ToString()); //} for (int i = 0; i { list.Add(prefixText+i.ToString()); } return list.ToArray(); }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn