streamReader and writer


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: streamReader and writer

  1. #1
    Join Date
    Dec 2005
    Posts
    9

    streamReader and writer

    hey all

    does anyone know how i can read text from a website and write the information into a database table using streamreader and streamwriter??

    anyone know how or any good tutorials??

    thanks (once again!!!)

  2. #2
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    This article is on screen scrapes in the same lines you are looking to read web pages, this code assigns the web page text to a label , you can use a reader/ writer and access the database , does that help?

    http://www.4guysfromrolla.com/webtech/070601-1.shtml
    Sri

  3. #3
    Join Date
    Dec 2005
    Posts
    9
    thanks for the information,

    but what i need to know is how can i take a screen scrape and put the information into a table in my MS Access database?

  4. #4
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    Isnt the screen scrape available as a string,So lets say you are saving the entire html
    I am not sure it is this that you want i am giving you code for sql server
    SqlConnection sqlCon = new SqlConnection(connectionstring);
    sqlCmd.CommandText = "INSERT INTO TABLENAME VALUES (" +stringofhtml + ");";
    sqlCmd.CommandType = CommandType.Text;
    sqlCmd.Connection = sqlCon;
    sqlCmd.ExecuteNonQuery();
    TABLENAME, connString should be dependent on your database
    Sri

  5. #5
    Join Date
    Dec 2005
    Posts
    9
    thanks for the information

    what i am exactly trying to do is go to a website for example a weather website and take the days temperature and write that to my database i shall be using MS Access database what i need to know is how can i use streamReader to read the temperature and then streamWriter to write it directly to my database?

  6. #6
    Join Date
    May 2005
    Location
    UK
    Posts
    278
    The resultant string will be a regular html document you will have to understand the format and parse it to get the information.
    Isnt there a web service you can use which will give back the value instead of a website. In your case consuming a webservice makes sense I mean imagine trying to find the value on the page as per your requirement, could be difficult
    Sri

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center