hello all,

i want to save the web page content into a database. how can i fetch data from that website and save into a sql database. im using c# as front end.

need help.

expecting reply soon since it needed for my project.

thanks.

Recommended Answers

All 5 Replies

u can do this as
following code should be used in codebehind page load method or any u should know better from where u want the desired out put should be saved.
<code> System.Text.StringBuilder sb = new StringBuilder();
TextWriter tWriter=new StringWriter(sb);
HtmlTextWriter htmlWriter=new HtmlTextWriter(tWriter);
this.Render(htmlWriter);
string outputResponseForDb=sb.ToString();
</code>

sorry to ask u silly like this,

where should i place ur code..

help me pls

u should place in last line of page load method

i want to fetch the table of contents. lets say if there is a web page which has the table i want to save that whole table contents on to sql server database.. how can i do it programmatically.

help me.

thanks

outputResponseForDB sttring has all html if there is only one table then use indexOf("table") to get the index of starting index and last index then substring on outputResponseForDB would do the job

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.