streamReader and writer
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!!!)
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?
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?
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;
TABLENAME, connString should be dependent on your database
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?
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
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center