Create folder
-
1. How can i create a folder in a particular path using c#. 2. I have sorted content in a dataview, how can i assign the content to data table. Jey
Hi, 1. Directory.CreateDirectory(path); 2. You would have to manually crate a new DataTable and then copy the contents of the view row by row. What are you actually trying to do? You could for example directly assign the DataView to a DataGrid and it will show it like its currently sorted. Robert
-
Hi, 1. Directory.CreateDirectory(path); 2. You would have to manually crate a new DataTable and then copy the contents of the view row by row. What are you actually trying to do? You could for example directly assign the DataView to a DataGrid and it will show it like its currently sorted. Robert
-
Hi, 1. Directory.CreateDirectory(path); 2. You would have to manually crate a new DataTable and then copy the contents of the view row by row. What are you actually trying to do? You could for example directly assign the DataView to a DataGrid and it will show it like its currently sorted. Robert
thanks Robert. Actually i am reading string content from the text file(.txt) using stream reader. I am copying all those data to data table for each column. after sorting the data by particular column, that sorted content should be assigned to data table and write it to output file(.txt) too. These operations should be done without using data set and data grid. Jey
-
thanks Robert. Actually i am reading string content from the text file(.txt) using stream reader. I am copying all those data to data table for each column. after sorting the data by particular column, that sorted content should be assigned to data table and write it to output file(.txt) too. These operations should be done without using data set and data grid. Jey
Do you really need to transfer the data int oa DataTable? You could directly write the contents of the DataView. I assume you are writing with a loop like:
foreach (DataRow dataRow in dataTable.Rows) {
//...
}If you have a DataView the equivalent code would look like:
foreach (DataRowView dataRowView in dataView) {
DataRow dataRow = dataRowView.Row;
//...
}The difference would only be the sorting. Robert