欢迎光临
我们一直在努力

建站超值云服务器,限时71元/月

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.

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 »
分享到: 更多 (0)

相关推荐

  • 暂无文章