国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 常熟市| 卢氏县| 安龙县| 娄底市| 行唐县| 杭锦后旗| 惠州市| 讷河市| 独山县| 公安县| 荔波县| 白城市| 上林县| 会泽县| 河东区| 海口市| 梁平县| 仙居县| 磐石市| 乡宁县| 怀集县| 龙江县| 政和县| 阳东县| 九龙城区| 万年县| 靖边县| 静乐县| 阿城市| 杭锦后旗| 交口县| 贺兰县| 家居| 临沭县| 石家庄市| 阳春市| 江油市| 贡觉县| 荃湾区| 林芝县| 汉源县|