![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi Is there any way of declaring an array of DataRow of variable size (or dynamic array) in ADO.net as the fowwing syntax require the size of the array. array<DataRow^>^ rows= gcnew array<DataRow^>(size); I am searching my SQL Server2005 databases DataTable for a given column value using DataTable::Select method and I don't know how many rows will it return depending on the selection criteria. Thanks for any help. Manjree |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
DataTable is the standard object as collection for datarows. Trying to set a DataTable in another array is a little bit impossible because the DataRow needs is companion collection The DataColumns, which is also part of the datatable. Cor "Manjree Garg" <garg (AT) newsgroup (DOT) nospam> schreef in bericht news:12A5F6FA-E2CE-460F-B75D-525FE3DE7BA0 (AT) microsoft (DOT) com... Hi Is there any way of declaring an array of DataRow of variable size (or dynamic array) in ADO.net as the fowwing syntax require the size of the array. array<DataRow^>^ rows= gcnew array<DataRow^>(size); I am searching my SQL Server2005 databases DataTable for a given column value using DataTable::Select method and I don't know how many rows will it return depending on the selection criteria. Thanks for any help. Manjree |
#5
| |||
| |||
|
|
Hi Wen I am still looking for the resolutio of my problem "How to store rows returned by a selection criteria as the no. of rows returned are not fixed?" I really appriciate your help. Thanks. Manjree "Cor Ligthert[MVP]" wrote: DataTable is the standard object as collection for datarows. Trying to set a DataTable in another array is a little bit impossible because the DataRow needs is companion collection The DataColumns, which is also part of the datatable. Cor "Manjree Garg" <garg (AT) newsgroup (DOT) nospam> schreef in bericht news:12A5F6FA-E2CE-460F-B75D-525FE3DE7BA0 (AT) microsoft (DOT) com... Hi Is there any way of declaring an array of DataRow of variable size (or dynamic array) in ADO.net as the fowwing syntax require the size of the array. array<DataRow^>^ rows= gcnew array<DataRow^>(size); I am searching my SQL Server2005 databases DataTable for a given column value using DataTable::Select method and I don't know how many rows will it return depending on the selection criteria. Thanks for any help. Manjree |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Hello Manjree, Just as what Cor said, the Property Table->Rows->Count will return the number of rows in current Table. If rows retruned by Table::Select() method, Table->Select()->Length proptery could tell us how many rows retruned by this selection criteria. Try the following line: array<System: ata: ataRow^>^ rows=gcnewarray<System: ata: ataRow^>(MyTable->Select("ID>100")->Length);rows=MyTable->Select("ID>100"); Hope this helps. Please let me know if you have any more concern. It's my pleasure to assist you. Have a great day. Best regards, Wen Yuan Microsoft Online Community Support ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
Hello Manjree, Try the following code line. pSrchRows=gcnew array<DataRow^>((pSrchTable1->Select(L"supplierID = 'aaa' "))->Length); The column in the filter criteria should be the name of Column (supplierID) rather than the name of object (pSrchColumn1). http://msdn2.microsoft.com/en-us/library/det4aw50.aspx [DataTable.Select Method (String)] Hope this help. Please let me know if this works for you. I will follow up. It's my pleasure to assist you. Have a great day. Best regards, Wen Yuan Microsoft Online Community Support ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. |
#10
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |