在javascript中从数组列表中加载数组

时间:2017-01-05 06:27:17

标签: javascript c# arrays

这里我将数组从数据表加载到数组列表。

public static ArrayList LoadView()  

    {  
    DataTable dt = new DataTable();  
    DataView view = new DataView(dt);  
    view.RowFilter = (("Name='AD'"));  
    DataTable dtcopy = view.ToTable("Selected", false, "Row1", "Row2");  
    var arr = dtcopy.Rows.Cast<DataRow>().Select(r => r.ItemArray).ToArray();  
    ItemList.Add(arr1);  

    DataView view2 = new DataView(dt);  
    view2.RowFilter = (("Name='ProE'"));  
    DataTable dtcopy2 = view2.ToTable("Selected", false, "Row1", "Row2");  
    // remove some column from datatable  
    var arr2 = dtcopy2.Rows.Cast<DataRow>().Select(r => r.ItemArray).ToArray();//Convert datatable to array    
    ItemList.Add(arr2);  

    return Itemlist;   
    } 

Itemlist包含数组arr1,数组arr2.Now我从数组列表中分离数组。

Javascript:  
PageMethods.LoadView();  
function LoadSucc(obj)//Returned arraylist  
{  
var goog1 = [];  
goog1 = arr1;  

var goog2 = [];  
goog2 = arr2;  
 }  

但是我无法得到解决方案。提出一些想法来解决我的问题。答案而不是评论。

0 个答案:

没有答案