Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Create folder

Create folder

Scheduled Pinned Locked Moved C#
csharpquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SysJey
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • S SysJey

      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

      R Offline
      R Offline
      Robert Rohde
      wrote on last edited by
      #2

      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

      R S 2 Replies Last reply
      0
      • R Robert Rohde

        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

        R Offline
        R Offline
        Reza Raad
        wrote on last edited by
        #3

        System.IO.Directory.CreateDirectory("c:\\one");

        1 Reply Last reply
        0
        • R Robert Rohde

          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

          S Offline
          S Offline
          SysJey
          wrote on last edited by
          #4

          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

          R 1 Reply Last reply
          0
          • S SysJey

            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

            R Offline
            R Offline
            Robert Rohde
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups