KoReKuRai
BusinessTravelHealthMORE

Managing blog articles in local database. Generate web pages with Windows Form and MS Access.

clock ASP.NET
twitter
facebook
googleplus
line
line
line
日本語
csharpaspnet

I wanted to manage all of my blog contents locally, so I saved all the contents in MS Access table and generated HTML pages from Windows form application. All updates are currently published from this application.

Pages need to be uploaded from FTP site but the use of this application is very effective when updating design or format of web pages.

sponsored link

Below is a diagram showing the steps on how the application works.

csharpaspnet

1.Retrieve data with GetData from MS Access table using TableAdapter.Fill
At OnLoad, load data from MS Access table onto form.

2.AppendLine HTML tags and DataGridView.Rows[i].Cells[i].Value with StringBuilder
At OnClick, store table records in string.

3.WriteLine String to web page with StreamWriter
Generate HTML page for each record in table.

 

Here is the basic portion of the script.


for (int i = 0; i < DataGridView.RowCount; i++)
{
	StringBuilder sb = new StringBuilder();
	sb.AppendLine("<title>" + DataGridView.Rows[i].Cells[j].Value + "</title>");

	using (StreamWriter outFile = new StreamWriter(Directory.GetCurrentDirectory() + @"\" + DataGridView.Rows[i].Cells[j].Value + ".html", false, Encoding.GetEncoding("UTF-8")))
	{
		outFile.WriteLine(sb.ToString());
		outFile.Close();
	}
}

upBenefits of local content management

downDown sides

Not all is good with local content management but having the option to gain control of all your articles is fascinating. With the use of Visual Studio, MS Access and updates to the above script, it shouldn't be difficult to create a local content management application, so give it a try if you wish.

sponsored link

Related Items


twitter
facebook
googleplus
line
line
line
日本語
Top
sponsored link

CATEGORY

ABOUT ME

Hi I'm KoReKuRai, which means 'About this much' in Japanese. Living in Kanagawa prefecture located near Tokyo, Japan. I'm an IT engineer working mostly at non-domestic companies for over 12 years, now spending much time with my 2 year old son. This blog is all about business work style, job transfer, interview, travel, business trips, site development, programming, childcare, health from a Japanese perspective. Ignore my Japanese English and hope you feel interested. You can contact me at here. Thanks for your attention.

Copyright 2017 KoReKuRai All rights reserved.