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(); }
webService代码: using System; using System.Web; using System.Collections; using System.Web.Services; using System.Web.Services.Protocols; /// /// AutoComplete 的摘要说明 /// [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(COnformsTo= WsiProfiles.BasicProfile1_1)] //下面是必须的,否则功能无法实现 [System.Web.Script.Services.ScriptService] public class AutoComplete : System.Web.Services.WebService { public AutoComplete () { //如果使用设计的组件,请取消注释以下行 //InitializeComponent(); } [WebMethod] public string HelloWorld() { return "Hello World"; } [WebMethod] 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(); } } 有哪里不对的地方还请大家指教
本文介绍了如何在HTML5网页模板中加入百度统计,并对模板文件、css样式表、js插件库等内容进行了说明。同时还解答了关于HTML5网页模板的使用方法、表单提交、域名和空间的问题,并介绍了如何使用Visual Studio 2010创建HTML5模板。此外,还提到了使用Jquery编写美好的HTML5前端框架模板的方法,以及制作企业HTML5网站模板和支持HTML5的CMS。 ...
[详细]