Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to make an application which retrives the data from one webpage and stores it in ms access database....for example whenever I enter the url in textbox and click the button then data of that perticulre page will be stored in my DB...I will make my databse according whatever data will be stored in it...e.g. Number field for numeric data,Date field for Dates and so on......but I couldn't get more idea about how to get the data from webpage??? Will my application depends on format of the webpage??? pls help me to start my application if any referance project is availabe then suggest me....
Posted

1 solution

Typically how this is done is to use ASP controls on the page, then collect the data on postback.

Build your form, and add a asp:Button control labeled, say, "Save Data". In the Click event for that button, go through all of the input controls and save the values into local variables. Use the Trim method on text values to clean them up. If you are chosing to do your validation server-side (although using the Validation controls are often a better way to go) you would validate the information now.

Then, build an INSERT command using this data and store it into your database. It has been a very long time since I've used Access, but I believe it supports parameterized statements: use those, rather than building your INSERT inline. That way, you don't have to worry about single quotes or injection attacks. Once the data is stored, hide the Panel with the data input by setting its Visible property to False and show a panel with a "Your data has been saved" message. Or, you could use Response.Redirect to take the user to a different page.
 
Share this answer
 
Comments
NikulDarji 17-Sep-11 2:19am    
Hey..thankx for your suggestion....but can u tell me that, this idea will work for all webpages or depends on only one perticulre page....because all webpage doesn't contain same things....means some pages have 2 headers some has 1 header or without header etc...?????
Gregory Gadow 17-Sep-11 2:24am    
The idea will work on any page, but you will have to customize it to fit the data input boxes that are specific to that one page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900