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. Web Development
  3. ASP.NET
  4. Help

Help

Scheduled Pinned Locked Moved ASP.NET
htmlhelpquestion
3 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.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    I have a text document containing some records Lets say there exists two rows and two columns Among the two columns, one is the email ID Now what i have to do is, To collect the info and place it in a HTML file and i have to send an email to the specified mailId with some subject How can i accomplish this Can any one help me Thanks in advance, :)

    D M 2 Replies Last reply
    0
    • A Anonymous

      I have a text document containing some records Lets say there exists two rows and two columns Among the two columns, one is the email ID Now what i have to do is, To collect the info and place it in a HTML file and i have to send an email to the specified mailId with some subject How can i accomplish this Can any one help me Thanks in advance, :)

      D Offline
      D Offline
      deanofharvard
      wrote on last edited by
      #2

      I'm assuming your text file's delimited... Just grab the text file data using a FileStream object, and parse it into a string array. You can either read it line by line, or grab the whole thing, separate by \n\r, and then parse the fields as you go. I think there's a way to actually use a CSV as a datasource too... May be wrong on that one... It's been a long time since I've mailed anyone through code, so someone else'll have to give you tips on that one. Access the text file using the FileStream object will get you started...

      1 Reply Last reply
      0
      • A Anonymous

        I have a text document containing some records Lets say there exists two rows and two columns Among the two columns, one is the email ID Now what i have to do is, To collect the info and place it in a HTML file and i have to send an email to the specified mailId with some subject How can i accomplish this Can any one help me Thanks in advance, :)

        M Offline
        M Offline
        minhpc_bk
        wrote on last edited by
        #3

        Hi there, In addition to using the classes defined in the System.IO namespace to access the text .txt file, you can also use ADO.NET to treat your text file as a datasource like Access, SQL .... The sample code can be simple like this:

        try
        {
        string conStr = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\TextDBFolder\;
        Extended Properties=""text;HDR=No;FMT=Delimited""";
        OleDbConnection con = new OleDbConnection(conStr);
        OleDbDataAdapter adapter = new OleDbDataAdapter("Select * from TextDB.txt", con);
        DataSet ds = new DataSet();
        adapter.Fill(ds, "TextDB");
        }
        catch(OleDbException ex)
        {
        Console.Out.WriteLine(ex.Message);
        }

        For more information, you can see Accessing Data with ADO.NET[^]

        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