Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
GeneralPrint button with SSRS Pin
clydeJones19-Jul-04 8:51
clydeJones19-Jul-04 8:51 
GeneralDynamic Help Using HtmlHelp API and COM Interfaces Pin
JimmyG1319-Jul-04 7:57
JimmyG1319-Jul-04 7:57 
GeneralKeyDown event is not firing while draging node on treeview Pin
god4k19-Jul-04 6:51
god4k19-Jul-04 6:51 
GeneralRe: KeyDown event is not firing while draging node on treeview Pin
leppie19-Jul-04 6:59
leppie19-Jul-04 6:59 
GeneralRe: KeyDown event is not firing while draging node on treeview Pin
Heath Stewart19-Jul-04 9:10
protectorHeath Stewart19-Jul-04 9:10 
GeneralReturning a filtered DataTable Pin
Andy H19-Jul-04 6:44
Andy H19-Jul-04 6:44 
GeneralRe: Returning a filtered DataTable Pin
Werdna19-Jul-04 8:58
Werdna19-Jul-04 8:58 
GeneralRe: Returning a filtered DataTable Pin
Heath Stewart19-Jul-04 9:04
protectorHeath Stewart19-Jul-04 9:04 
I would recommend you don't disconnect the DataRow from its DataTable. There is a lot of other information in there, such as change information - not to mention that the column definitions are part of the DataTable (which you didn't replicated; FWIW, the easiest way to do that is DataTable.Clone, which replicates only the structure).

An array of DataRows is still bindable, as well. An array implements IList so that you can bind it to a DataTable, ComboBox, or any other control. In this case, it's much better to bind against a DataView instantiated with the DataTable as the ctor parameter, then use the RowFilter property. This will track all changes.

If you don't need binding or change tracking and just want a simple list of DataRows, then you'll either have to cope with the array, remove them from the old table and add them to the new table (and use a reverse for loop - changing the enumerable will throw an exception), or use Array.CopyTo (inheritted from your DataRow[]) which will perform a deep copy (a shallow copy won't solve your problem, since it only copies a reference to the original (same) object).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Returning a filtered DataTable Pin
Andy H19-Jul-04 22:40
Andy H19-Jul-04 22:40 
Generalfunction usage in a .config file Pin
Ryan@Salamandertechnologies.com19-Jul-04 6:39
sussRyan@Salamandertechnologies.com19-Jul-04 6:39 
GeneralRe: function usage in a .config file Pin
Heath Stewart19-Jul-04 8:38
protectorHeath Stewart19-Jul-04 8:38 
GeneralRe: function usage in a .config file Pin
RB@Emphasys19-Jul-04 9:02
RB@Emphasys19-Jul-04 9:02 
GeneralRe: function usage in a .config file Pin
Heath Stewart19-Jul-04 9:07
protectorHeath Stewart19-Jul-04 9:07 
GeneralRe: function usage in a .config file Pin
Andy Brummer19-Jul-04 9:12
sitebuilderAndy Brummer19-Jul-04 9:12 
GeneralRe: function usage in a .config file Pin
RB@Emphasys19-Jul-04 9:48
RB@Emphasys19-Jul-04 9:48 
GeneralApplicationException VS Exception Pin
Gimpy198319-Jul-04 5:00
Gimpy198319-Jul-04 5:00 
GeneralRe: ApplicationException VS Exception Pin
Heath Stewart19-Jul-04 5:30
protectorHeath Stewart19-Jul-04 5:30 
GeneralCalled but not executed :confused: Pin
Gimpy198319-Jul-04 4:54
Gimpy198319-Jul-04 4:54 
GeneralRe: Called but not executed :confused: Pin
Heath Stewart19-Jul-04 5:35
protectorHeath Stewart19-Jul-04 5:35 
GeneralRe: Called but not executed :confused: Pin
Gimpy198319-Jul-04 9:27
Gimpy198319-Jul-04 9:27 
GeneralRe: Called but not executed :confused: Pin
Heath Stewart19-Jul-04 9:32
protectorHeath Stewart19-Jul-04 9:32 
GeneralGoing Unmanaged doesn't free Memory Pin
Guilio karadanais19-Jul-04 4:24
Guilio karadanais19-Jul-04 4:24 
GeneralRe: Going Unmanaged doesn't free Memory Pin
Heath Stewart19-Jul-04 4:37
protectorHeath Stewart19-Jul-04 4:37 
GeneralRe: Going Unmanaged doesn't free Memory Pin
Guilio karadanais19-Jul-04 5:07
Guilio karadanais19-Jul-04 5:07 
GeneralHex to Dec conversion (big numbas!) Pin
Blubbo19-Jul-04 4:06
Blubbo19-Jul-04 4:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.