asp.net list集合需要到什么包吗?List<string> list = new List<string>();list不变色啊!
usingSystem;usingSystem.Collections;usingSystem.Linq;usingSystem.Web;usingSystem.Web....
using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data;
using System.Data.SqlClient;
public string[] GetJobAll(string prefixText,int count)
{
string key = prefixText + "%";
string sql = "select top " + count + "Job_Jobs from Lxhr_tb_Job where Job_Jobs like'"+key+"'";
da = new SqlDataAdapter(sql,sqlcon);
DataSet ds = new DataSet();
da.Fill(ds);
List<string> list = new List<string>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
list.Add(dr["Job_Jobs"].ToString());
}
return list.ToArray();
} 展开
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.Data;
using System.Data.SqlClient;
public string[] GetJobAll(string prefixText,int count)
{
string key = prefixText + "%";
string sql = "select top " + count + "Job_Jobs from Lxhr_tb_Job where Job_Jobs like'"+key+"'";
da = new SqlDataAdapter(sql,sqlcon);
DataSet ds = new DataSet();
da.Fill(ds);
List<string> list = new List<string>();
foreach (DataRow dr in ds.Tables[0].Rows)
{
list.Add(dr["Job_Jobs"].ToString());
}
return list.ToArray();
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询