Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataRow[] row = table.Select("Weight='57'");// has 1 record
- DataTable dt = new DataTable();
- foreach (DataRow dr in row)
- {
- dt.ImportRow(dr);
- }
- dt.AcceptChanges();
- DataTable dtDest = new DataTable();
- dtDest = dsActivity.Tables[0].Clone();
- foreach(DataRow dr in dsSrc.Tables[0].Rows)
- {
- DataRow newRow = dtDest .NewRow();
- newRow.ItemArray = dr.ItemArray;
- dtDest.Rows.Add(newRow);
- }
- DataRow[] rows = table.Select("Weight='57'");
- DataTable dt = new DataTable();
- foreach (DataRow item in rows)
- {
- // add values into the datatable
- dt.Rows.Add(item.ItemArray);
- }
- dt.Rows.Add(dr)
- DataTable DT = DTMain.Clone();
- // suppose DT is the table where we need to put datarows and DTMain is a table
- // having the stucture of the datatbale, means you must have some structure for
- // datatable.
- //supposes you have a collection of datarows as
- foreach(DataRow dr in DatarRowColl)
- {
- DT.ImportRow(dr);
- }
- DT.AcceptChanges();
- // here you get the datarows in a datatable.
- DataTable dt = new DataTable();
- DataRow[] dr = dt.Select("Your string");
- DataTable dt1 = dr.copyToDataTable();
Add Comment
Please, Sign In to add comment