Moving records

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • klatha
    New Member
    • Nov 2008
    • 3

    #1

    Moving records

    Hi everybody

    How to move selected records in gridview to a Folder in th system directly. with out using open,savefiledi alogs using asp.net code.


    Thanks in /advance
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Not sure I understand your question. Do you need to move the location of a file saved in a DB or create a file out of data and save it?

    Comment

    • balabaster
      Recognized Expert Contributor
      • Mar 2007
      • 798

      #3
      Check out the System.IO namespace for accessing drive resources. You can create a new file object and dump the data into the file and then save the file out using:

      Code:
      Dim oFile As System.IO.StreamWriter = System.IO.File.CreateText("MyFile.txt")
      oFile.WriteLine(Data)
      oFile.Flush()
      oFile.Close()
      It really depends on what format you want the file data saved in as to which class you use to save the data to disk. You have to ask yourself what format you want to save the data in in order to decide what the correct class is.

      Comment

      • klatha
        New Member
        • Nov 2008
        • 3

        #4
        Thanku balabaster

        I want data in Excel sheet.

        where this "Myfile.txt " is stored.

        System.IO.Strea mWriter sw= System.IO.File. CreateText("dat a.xls");
        sw.WriteLine(gd );
        sw.Flush();
        sw.Close();

        for WtiteLine can pass gd(gridview)

        Comment

        • klatha
          New Member
          • Nov 2008
          • 3

          #5
          Thanku balabaster

          I want data in Excel sheet.

          where this "Myfile.txt " is stored.

          System.IO.Strea mWriter sw= System.IO.File. CreateText("dat a.xls");
          sw.WriteLine(gd );
          sw.Flush();
          sw.Close();

          for WtiteLine can i pass gd(gridview)

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            You can write to excel using ADO.NET.

            Comment

            Working...