Re: How to create a datatable object from a datarow [].
where did you get the array of datarows?? the only way i know of is
looping through them and using dt.Rows.Add(... ); if there's a better
way, i'd also like to know...
Re: How to create a datatable object from a datarow [].
"Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
in message news:uqEyFqxTFH A.580@TK2MSFTNG P15.phx.gbl...[color=blue]
> Hi,
>
> What about using a DataView ?
>[/color]
Could you please explain based on the code posted earlier?
Re: How to create a datatable object from a datarow [].
Basically, it would be along the lines of:
DataSet ds=GetDataSet() ;
DataTable dt=ds.Tables[0];
DataView dv = new DataView(dt, "filter expression", "sort expression",
DataViewRowStat e.CurrentRows)
return dv;
where "filter expression" would be exactly as you'd write it in a WHERE
clause, and sort expression just as you'd write it in a ORDER BY.
Presumably, you have a better way of expressing the subset you want to
filter on, than "rows 5 thru 11"/
--
--
Truth,
James Curran
[erstwhile VC++ MVP]
"jensen bredal" <jensen.bredal@ yahoo.dk> wrote in message
news:ujGrWyxTFH A.2420@TK2MSFTN GP12.phx.gbl...[color=blue]
>
> "Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us >[/color]
wrote[color=blue]
> in message news:uqEyFqxTFH A.580@TK2MSFTNG P15.phx.gbl...[color=green]
> > Hi,
> >
> > What about using a DataView ?
> >[/color]
>
> Could you please explain based on the code posted earlier?
>
> JB
>
>[/color]
Comment