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. save a file as .csv formate

save a file as .csv formate

Scheduled Pinned Locked Moved C#
announcement
9 Posts 4 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.
  • M Offline
    M Offline
    MS Lee
    wrote on last edited by
    #1

    friendz, am doing an application which allows user to write their email address in a text box, while saving this i need to store this in to a .csv file. is it possible to create a .csv file at run time, and everytime i need to update the file....

    self confidence+hard work=SUCCESS

    C L 2 Replies Last reply
    0
    • M MS Lee

      friendz, am doing an application which allows user to write their email address in a text box, while saving this i need to store this in to a .csv file. is it possible to create a .csv file at run time, and everytime i need to update the file....

      self confidence+hard work=SUCCESS

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      MS Lee wrote:

      friendz

      To form a plural in English the general rule is to add an "s" to the end of the word. Adding a "z" makes you look like a marketing person trying to connect with teenagers.

      MS Lee wrote:

      is it possible to create a .csv file at run time

      Yes, a CSV file is simply one where the Values are Separated by Commas. You can use StringBuilder or string.Format to build each line and then write it to the stream like any other file.

      Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

      M C 2 Replies Last reply
      0
      • M MS Lee

        friendz, am doing an application which allows user to write their email address in a text box, while saving this i need to store this in to a .csv file. is it possible to create a .csv file at run time, and everytime i need to update the file....

        self confidence+hard work=SUCCESS

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        As far as I remember there a many articles about CSV-files here on CodeProject. Please use the search functionality.

        1 Reply Last reply
        0
        • C Colin Angus Mackay

          MS Lee wrote:

          friendz

          To form a plural in English the general rule is to add an "s" to the end of the word. Adding a "z" makes you look like a marketing person trying to connect with teenagers.

          MS Lee wrote:

          is it possible to create a .csv file at run time

          Yes, a CSV file is simply one where the Values are Separated by Commas. You can use StringBuilder or string.Format to build each line and then write it to the stream like any other file.

          Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

          M Offline
          M Offline
          MS Lee
          wrote on last edited by
          #4

          thanks friend, but here i hv got stuck, i couldnt move further, each time whwn i add a email address i need to save with the existing file, .. i dont know to move further

          self confidence+hard work=SUCCESS

          C 1 Reply Last reply
          0
          • M MS Lee

            thanks friend, but here i hv got stuck, i couldnt move further, each time whwn i add a email address i need to save with the existing file, .. i dont know to move further

            self confidence+hard work=SUCCESS

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            MS Lee wrote:

            each time whwn i add a email address i need to save with the existing file,

            So, what code have you got so far?

            Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

            M 1 Reply Last reply
            0
            • C Colin Angus Mackay

              MS Lee wrote:

              friendz

              To form a plural in English the general rule is to add an "s" to the end of the word. Adding a "z" makes you look like a marketing person trying to connect with teenagers.

              MS Lee wrote:

              is it possible to create a .csv file at run time

              Yes, a CSV file is simply one where the Values are Separated by Commas. You can use StringBuilder or string.Format to build each line and then write it to the stream like any other file.

              Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

              C Offline
              C Offline
              CPallini
              wrote on last edited by
              #6

              Welcome in the CP's Memorable Quotes page [^], Colin. :-D

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              C 1 Reply Last reply
              0
              • C Colin Angus Mackay

                MS Lee wrote:

                each time whwn i add a email address i need to save with the existing file,

                So, what code have you got so far?

                Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

                M Offline
                M Offline
                MS Lee
                wrote on last edited by
                #7

                sorry sorry i just confused... am having a text box to get email address and a combo box to select its category for e.g category might be as IT Dept, Mech Dept and so, at the first form am inserting these to in to a table. in another form i have only the combo box which has loaded with the category data. when i select any category i need all the emails belongs to this category should come with a .csv file.. am stuck in " how to seperate emailid's as per the category and how to bundle it and make a .csv file at run time ... ?:confused:

                self confidence+hard work=SUCCESS

                1 Reply Last reply
                0
                • C CPallini

                  Welcome in the CP's Memorable Quotes page [^], Colin. :-D

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  C Offline
                  C Offline
                  Colin Angus Mackay
                  wrote on last edited by
                  #8

                  CPallini wrote:

                  Memorable Quotes page

                  It is an honour. :) You should link back to the original use of the quote for reference too.

                  Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

                  C 1 Reply Last reply
                  0
                  • C Colin Angus Mackay

                    CPallini wrote:

                    Memorable Quotes page

                    It is an honour. :) You should link back to the original use of the quote for reference too.

                    Developer Day Scotland 2 - Free community conference Recent blog posts: *Throwing Exceptions *Training Developers * Method hiding or overriding - or the difference between new and virtual

                    C Offline
                    C Offline
                    CPallini
                    wrote on last edited by
                    #9

                    Colin Angus Mackay wrote:

                    You should link back to the original use of the quote for reference too.

                    Maybe I'll do, thank you for suggesting. :)

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    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