private static string[] autoCompleteWordList = null;
public string[] GetCompleteDepart(int count,string sql,string filed)
{
if (count == )
{
count = ;
}
//如果数组为空 DataSet ds = new CommonDAO().ReturnDataSet(sql);//数据集
//填充数组
string[] temp = new string[ds.Tables[].Rows.Count];
int i = ;
foreach (DataRow dr in ds.Tables[].Rows)
{
temp[i] = dr[filed].ToString();//字段
i++;
}
//将临时数组的内容赋给返回数组
autoCompleteWordList = temp; string[] returnValue = new string[count];
returnValue = autoCompleteWordList;
//返回
return returnValue;
}

DataTable 转成字符串数组的更多相关文章

  1. 随笔 JS 字符串 分割成字符串数组 并动态添加到指定ID的DOM 里

    JS /* * 字符串 分割成字符串数组 并动态添加到指定ID的DOM 里 * @id 要插入到DOM元素的ID * * 输入值为图片URL 字符串 * */ function addImages(i ...

  2. js 字符串分割成字符串数组 遍历数组插入指定DOM里 原生JS效果

    使用的TP3.2 JS字符串分割成字符串数组 var images='{$content.pictureurl} ' ;结构是这样 attachment/picture/uploadify/20141 ...

  3. split 将字符串分割成字符串数组

    list_name = list_name.split(","); split() 方法用于把一个字符串分割成字符串数组. 语法 stringObject.split(separa ...

  4. Swift - 将字符串拆分成数组(把一个字符串分割成字符串数组)

    在Swift中,如果需要把一个字符串根据特定的分隔符拆分(split)成字符串数组,通常有如下两种方法: 1,使用componentsSeparatedByString()方法 1 2 3 4 5 l ...

  5. Java中将字符串用空格分割成字符串数组的split方法

    官方文档链接:public String[] split(String regex) 本文以空格作为分割串. CaseOne import java.util.Scanner; public clas ...

  6. fastjson异常(字符串集合转成字符串数组)

    我是在项目中,因为受到一个string类型的list集合,然后需要把这个字符串发送给前端,进行解析. 但是前端收到的是一个字符串,不能进行解析. 所以采用 ArrayUtils.clone(JSONO ...

  7. C++将string转化成字符串数组

    //str为需要截断的string,pattern为分隔符 std::vector<std::string> split(std::string str,std::string patte ...

  8. String的split()方法可以将字符串按照特定的分隔符拆分成字符串数组

    在java.lang包中有String.split()方法,返回是一个数组------不管按照什么拆,拆出来是一个数组 String str = "1,2,3,4,5,6"; St ...

  9. 看结果,测试?java中的String类 字符串拆分成字符串数组 判定邮箱地址 字符串比较 参数传递?

    看结果1? package com.swift; class ArrayString { public static void main(String[] args) { String str = & ...

随机推荐

  1. How To Tune or Test PLSQL Code Performance in Oracle D2k Forms

    You can test or tune your program unit performance in Oracle forms with Ora_Prof package.Suppose you ...

  2. hdu 1800 (map)

    链接:http://acm.hdu.edu.cn/showproblem.php?pid=1800 Flying to the Mars Time Limit: 5000/1000 MS (Java/ ...

  3. Codeforces Round #272 (Div. 2) C. Dreamoon and Sums 数学

    C. Dreamoon and Sums time limit per test 1.5 seconds memory limit per test 256 megabytes input stand ...

  4. STL--list

    List-概述: 列表List是一个线性链表结构(Double—Linked Lists,双链表),它的数据由若干个节点构成,每一个节点都包括一个信息块Info(即实际存储的数据).一个前驱指针Pre ...

  5. Redis基础知识之————空间换时间的查询案例

    空间与时间 空间换时间是在数据库中经常出现的术语,简单说就是把查询需要的条件进行索引的存储,然后查询时为O(1)的时间复杂度来快速获取数据,从而达到了使用空间存储来换快速的时间响应!对于redis这个 ...

  6. c++ 操作符 重载。

    操作符如关系操作符,全局函数的话,必须第一个是class. 1.赋值(=),下标([ ]),调用(())和成员访问箭头(->)等操作符必须定义为成员,如果定义为非成员的话,程序在编译的时候,会发 ...

  7. Python学习笔记11—函数

    建立第一个函数 /usr/bin/env Python #coding:utf-8 def add_function(a,b): c = a+b print c if __name__==" ...

  8. nginx相关优化

    1.配置监控nginx状态信息 vim /usr/locale/nginx/conf/nginx.conf server { listen ; server_name 192.168.1.30; lo ...

  9. NTFS reparse point

    https://en.wikipedia.org/wiki/NTFS_reparse_point NTFS HARD link: since Windows NT4: files on the sam ...

  10. MATLAB中的nargin与varargin的用法

    nargin的用法: nargin:number of function input arguments,指的是一个函数的输入变量的个数. 用法:nargin或着nargin(fx), 其中fx指的是 ...