国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發(fā) > 綜合 > 正文

如何搜索DataTable中的值

2024-07-21 02:22:33
字體:
來源:轉載
供稿:網(wǎng)友
中國最大的web開發(fā)資源網(wǎng)站及技術社區(qū),
gets a specified datarow.

overload list
gets the row specified by the primary key value.

[visual basic] overloads public function find(object) as datarow
[c#] public datarow find(object);
[c++] public: datarow* find(object*);
[jscript] public function find(object) : datarow;
gets the row containing the specified primary key values.

[visual basic] overloads public function find(object()) as datarow
[c#] public datarow find(object[]);
[c++] public: datarow* find(object*[]);
[jscript] public function find(object[]) : datarow;
example
[visual basic, c#] the following example uses the values of an array to find a specific row in a collection of datarow objects. the method presumes a datatable exists with three primary key columns. after creating an array of the values, the code uses the find method with the array to get the particular object desired.

[visual basic, c#] note   this example shows how to use one of the overloaded versions of find. for other examples that might be available, see the individual overload topics.
[visual basic]
private sub findinmultipkey(byval mytable as datatable)
   dim foundrow as datarow
   ' create an array for the key values to find.
   dim findthesevals(2) as object
   ' set the values of the keys to find.
   findthesevals(0) = "john"
   findthesevals(1) = "smith"
   findthesevals(2) = "5 main st."
   foundrow = mytable.rows.find(findthesevals)
   ' display column 1 of the found row.
   if not (foundrow is nothing) then
     console.writeline(foundrow(1).tostring())
   end if
end sub
[c#]
private void findinmultipkey(datatable mytable){
    datarow foundrow;
    // create an array for the key values to find.
    object[]findthesevals = new object[3];
    // set the values of the keys to find.
    findthesevals[0] = "john";
    findthesevals[1] = "smith";
    findthesevals[2] = "5 main st.";
    foundrow = mytable.rows.find(findthesevals);
    // display column 1 of the found row.
    if(foundrow != null)
      console.writeline(foundrow[1]);
}
[c++, jscript] no example is available for c++ or jscript. to view a visual basic or c# example, click the language filter button  in the upper-left corner of the page.

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 宁化县| 师宗县| 岫岩| 墨脱县| 葵青区| 泰兴市| 通渭县| 沾化县| 荔波县| 镇宁| 梨树县| 宜丰县| 镇远县| 平昌县| 吴忠市| 乐至县| 吴川市| 马边| 惠水县| 房产| 隆德县| 苏尼特右旗| 呼图壁县| 双江| 阳西县| 正蓝旗| 岳西县| 芦山县| 桃江县| 隆子县| 泰兴市| 邢台县| 深泽县| 山西省| 马边| 丹东市| 炎陵县| 黄大仙区| 阿拉善左旗| 崇阳县| 若尔盖县|