2013-07-16 423 views
0

我做了一個數據表,但想要將其更改爲列表視圖。convert datatable to listview vb.net

用vb.net

mycode的:

Dim table As New DataTable 

    ' columns in the DataTable. 
    table.Columns.Add("Monday", System.Type.GetType("System.Int32")) 
    table.Columns.Add("Tuesday", System.Type.GetType("System.Int32")) 
    table.Columns.Add("Wednesday", System.Type.GetType("System.Int32")) 
    table.Columns.Add("Thursday", System.Type.GetType("System.Int32")) 
    table.Columns.Add("Friday", System.Type.GetType("System.Int32")) 
    ' rows with those columns filled in the DataTable. 
    table.Rows.Add(1, 2005, 2000, 4000, 34) 
    table.Rows.Add(2, 3024, 2343, 2342, 12) 
    table.Rows.Add(3, 2320, 9890, 1278, 2) 
    table.Rows.Add(4, 3420, 1234, 4321, 89) 
    table.Rows.Add(5, 3240, 6600, 1100, 56) 
    table.Rows.Add(6, 4320, 1100, 3243, 23) 
    table.Rows.Add(7, 4540, 7645, 4324, 56) 
    table.Rows.Add(8, 4540, 4321, 8905, 43) 
    table.Rows.Add(9, 3420, 7654, 6780, 23) 
    table.Rows.Add(10, 4530, 6734, 9856, 21) 
    table.Rows.Add(11, 3240, 1278, 4327, 12) 

如何創建一個DataTable與列表視圖,與colume,星期一,星期二等等

回答