How to convert dataview to data table in .NET
hi can anybody help me in converting dataview to data table i have the folowing code dv = new DataView(ds.Tables["tblCustomerInfo"], "fldLastName ='"+strPasVal+"'", "fldID", DataViewRowState.CurrentRows);
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

rakesh chaudhari57 reputationPosted Jun 17, 2012, 10:11 PM EDT
Friend
private DataTable getsortedtable(DataTable dt) { dataview v=dt.defaultview; v.sort="columnName DESC"; dt=v.toTable(); return dt; }private DataTable getsortedtable(DataTable dt) { //do the operation for sort return dataView.ToTable(); } or DataView dv = new DataView(dt); dv.Sort = sortExpression + direction; tempTable = dv.Table.Clone(); foreach (DataRowView drv in dv) { tempTable.ImportRow(drv.Row); } tempTable.AcceptChanges(); dgrViewEmp.DataSource = dv; dgrViewEmp.DataBind();or
Please refer this link
http://www.netomatix.com/viewtotable.aspx
http://www.dotnetspark.com/kb/12-dataview-to-datatable-c-sharp.aspx
have a happy Coding