dt.select("[Status]='wait'")
#挑選出Column為“Status”裏面包含wait
dt.Select("[username] = ‘" +Convert.ToString(name) +"’")
#使用變量挑選, 挑選出表格"username"列中,名字為變量name='vincent'
str.gettype
獲取數據類型。
讀取壹個excel,得到datatable: dt1
循環每壹行的第14個cell,看是否數字:
row(14).tostring.isNumeric
------------------------------------------------------------------------------------
判斷壹個值是否字典中的鍵:
VarName.Item(Key) – returns the Dictionary item by its key?
VarName.Count – returns an Int32 value of the number of Dictionary items
VarName.ContainsKey(Key) – checks if the item with the given key exists in the Dictionary and returns a Boolean result
VarName.TryGetValue(Key, Value) – checks if an item with a given key exists in the Dictionary and returns a Boolean result and the value if found
Datatable
dt.rows(0).item(0).tostring ? #獲取第0行0列的單元數據
dt.rows(dt.rows.count-1).item(dt.columns.count-1).tostring #獲取最後壹行最後壹列數據
row(1).tostring.substring(row(1).tostring.indexof("CN")).tostring
可提取CN開頭的字符串