<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>Linglom&#039;s blog</title>
	<atom:link href="http://www.linglom.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linglom.com</link>
	<description>Just another IT weblog</description>
	<lastBuildDate>Thu, 27 May 2010 09:56:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Creating Graph with VB.NET, Part 3: Data Binding Chart to Database</title>
		<link>http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/</link>
		<comments>http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/#comments</comments>
		<pubDate>Thu, 27 May 2010 09:40:36 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Chart]]></category>
		<category><![CDATA[Dot Net]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=1153</guid>
		<description><![CDATA[From Part 1: Basic Chart and Part 2: Customize Chart, you see how to create a basic chart using GUI (no coding). But the chart is static, it&#8217;s lack flexibility which means that you cannot change properties or data of the chart while the application is running. Therefore, I will show how to create a [...]


Related posts:<ol><li><a href='http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 2: Customize Chart'>Creating Graph with VB.NET, Part 2: Customize Chart</a></li>
<li><a href='http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 1: Basic Chart'>Creating Graph with VB.NET, Part 1: Basic Chart</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>From Part 1: Basic Chart and Part 2: Customize Chart, you see how to create a basic chart using GUI (no coding). But the chart is static, it&#8217;s lack flexibility which means that you cannot change properties or data of the chart while the application is running. Therefore, I will show how to create a chart by coding and bind data from a SQL Server&#8217;s database to the Chart control.</p>
<p><span id="more-1153"></span></p>
<p><!-- Start AdLogger Wrapping Code -->
<?php @include_once("/usr/local/psa/home/vhosts/linglom.com/httpdocs/adlogger/ad_check_include.php"); if ($show_ads == 'y') { ?>

<script type="text/javascript"><!--
google_ad_client = "pub-7765165459812980";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text_image";
//2007-02-17: SquareonBlog
google_ad_channel = "6055254908";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "ce6531";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<?php } ?>
<!-- End AdLogger Wrapping Code --></p>
<p>On this example, I will create a connection to &#8220;<strong>Northwind</strong>&#8221; database on this SQL Server &#8220;<strong>BKKSQL001\INSTANCE01</strong>&#8221; and query product name and units in stock from &#8220;<strong>Products</strong>&#8221; table. Then, I create a chart and bind the query&#8217;s result to the chart.</p>
<h3>Step-by-step</h3>
<ol>
<li>Create a new Windows Application project on VB.NET and type name as &#8220;<strong>SampleDataBindChart</strong>&#8220;.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/_1.png" width="200" height="122" alt="Create New VB.NET's Windows Application" title="Create New VB.NET's Windows Application"  /></a></li>
<li>On <strong>Form1</strong>, open code window and import these libraries. The first two libraries are used for SQL. The last one is used for Chart.

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Data</span>
<span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Data</span>.<span style="color: #0000FF;">SqlClient</span>
&nbsp;
<span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Windows</span>.<span style="color: #0000FF;">Forms</span>.<span style="color: #0000FF;">DataVisualization</span>.<span style="color: #0000FF;">Charting</span></pre></div></div>

<p><a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/_2.png" width="200" height="122" alt="Import Required Libraries" title="Import Required Libraries"  /></a></li>
<li>Type code below on Form1_Load().

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="vbnet" style="font-family:monospace;">        <span style="color: #0600FF;">Dim</span> strConn <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Data Source=BKKSQL001\INSTANCE01;&quot;</span> <span style="color: #008000;">&amp;</span> _
            <span style="color: #808080;">&quot;Initial Catalog=Northwind;Integrated Security=True&quot;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> conn <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> SqlConnection<span style="color: #000000;">&#40;</span>strConn<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> sqlProducts <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;SELECT Top 8 ProductName, UnitsInStock FROM Products&quot;</span>
        <span style="color: #0600FF;">Dim</span> da <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> SqlDataAdapter<span style="color: #000000;">&#40;</span>sqlProducts, conn<span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">Dim</span> ds <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> DataSet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        da.<span style="color: #0000FF;">Fill</span><span style="color: #000000;">&#40;</span>ds, <span style="color: #808080;">&quot;Products&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> ChartArea1 <span style="color: #FF8000;">As</span> ChartArea <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> ChartArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">Dim</span> Legend1 <span style="color: #FF8000;">As</span> Legend <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> Legend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">Dim</span> Series1 <span style="color: #FF8000;">As</span> Series <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> Series<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">Dim</span> Chart1 <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> Chart<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">Controls</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>Chart1<span style="color: #000000;">&#41;</span>
&nbsp;
        ChartArea1.<span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;ChartArea1&quot;</span>
        Chart1.<span style="color: #0000FF;">ChartAreas</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>ChartArea1<span style="color: #000000;">&#41;</span>
        Legend1.<span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Legend1&quot;</span>
        Chart1.<span style="color: #0000FF;">Legends</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>Legend1<span style="color: #000000;">&#41;</span>
        Chart1.<span style="color: #0000FF;">Location</span> <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> System.<span style="color: #0000FF;">Drawing</span>.<span style="color: #0000FF;">Point</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">13</span>, <span style="color: #FF0000;">13</span><span style="color: #000000;">&#41;</span>
        Chart1.<span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Chart1&quot;</span>
        Series1.<span style="color: #0000FF;">ChartArea</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;ChartArea1&quot;</span>
        Series1.<span style="color: #0000FF;">Legend</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Legend1&quot;</span>
        Series1.<span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Series1&quot;</span>
        Chart1.<span style="color: #0000FF;">Series</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>Series1<span style="color: #000000;">&#41;</span>
        Chart1.<span style="color: #0000FF;">Size</span> <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> System.<span style="color: #0000FF;">Drawing</span>.<span style="color: #0000FF;">Size</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">800</span>, <span style="color: #FF0000;">400</span><span style="color: #000000;">&#41;</span>
        Chart1.<span style="color: #0000FF;">TabIndex</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>
        Chart1.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Chart1&quot;</span>
&nbsp;
        Chart1.<span style="color: #0000FF;">Series</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Series1&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">XValueMember</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;ProductName&quot;</span>
        Chart1.<span style="color: #0000FF;">Series</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Series1&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">YValueMembers</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;UnitsInStock&quot;</span>
&nbsp;
        Chart1.<span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> ds.<span style="color: #0000FF;">Tables</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Products&quot;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p><strong>Code Explanation</strong>:</p>
<ul>
<li>Line 1-2: Define a connection string to connect to a database on SQL Server.
<ul>
<li><strong>Data Source</strong> is a SQL Server name.</li>
<li><strong>Initial Catalog</strong> is a database name.</li>
<li>Set <strong>Integrated Security=True</strong> to use the current user as identity to access the SQL Server database.</li>
</ul>
</li>
<li>Line 4: Create a SqlConnection&#8217;s object.</li>
<li>Line 6: Define SQL query string.</li>
<li>Line 7-9: Execute the query and populate result to DataSet&#8217;s object.</li>
<li>Line 11-14: Create Chart&#8217;s objects.</li>
<li>Line 15: Add Chart&#8217;s object to the form.</li>
<li>Line 17-29: Set Chart&#8217;s properties (ChartArea, Legend and Series).</li>
<li>Line 31-32: Bind column &#8220;<strong>ProductName</strong>&#8221; to X-axis and column &#8220;<strong>UnitsInStock</strong>&#8221; to Y-axis on the &#8220;<strong>Series1</strong>&#8221; Chart.</li>
<li>Line 34: Set Chart&#8217;s data source to the DataTable in the DataSet&#8217;s object.</li>
</ul>
<p><a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/_3.png" width="200" height="150" alt="Form1_Load's code" title="Form1_Load's code"  /></a></li>
<li>Run the project. You see a chart displaying &#8220;<strong>Product Name</strong>&#8221; on X-axis and &#8220;<strong>Unit in Stock</strong>&#8221; on Y-axis which data is gathered from Northwind database on SQL Server.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/4.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-3/_4.png" width="200" height="121" alt="A chart binding to Database on SQL Server" title="A chart binding to Database on SQL Server"  /></a></li>
</ol>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 2: Customize Chart'>Creating Graph with VB.NET, Part 2: Customize Chart</a></li>
<li><a href='http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 1: Basic Chart'>Creating Graph with VB.NET, Part 1: Basic Chart</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Creating Graph with VB.NET]]></series:name>
	</item>
		<item>
		<title>Creating Graph with VB.NET, Part 2: Customize Chart</title>
		<link>http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/</link>
		<comments>http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/#comments</comments>
		<pubDate>Fri, 14 May 2010 07:45:20 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Chart]]></category>
		<category><![CDATA[Dot Net]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=1151</guid>
		<description><![CDATA[On Part 1: Basic Chart, I show how to create a basic chart with default chart type and color style. Now you will see how to customize those properties on a chart. Sections Sample chart Change chart type Change color style Insert title to chart 3D chart Sample chart The sample chart that I use [...]


Related posts:<ol><li><a href='http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 1: Basic Chart'>Creating Graph with VB.NET, Part 1: Basic Chart</a></li>
<li><a href='http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 3: Data Binding Chart to Database'>Creating Graph with VB.NET, Part 3: Data Binding Chart to Database</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>On Part 1: Basic Chart, I show how to create a basic chart with default chart type and color style. Now you will see how to customize those properties on a chart.</p>
<p><span id="more-1151"></span></p>
<p><!--adsense#Square--></p>
<p><a name="top"></a></p>
<h3>Sections</h3>
<ul>
<li><a href="#1">Sample chart</a></li>
<li><a href="#2">Change chart type</a></li>
<li><a href="#3">Change color style</a></li>
<li><a href="#4">Insert title to chart</a></li>
<li><a href="#5">3D chart</a></li>
</ul>
<p><a name="1"></a></p>
<h3>Sample chart</h3>
<p>The sample chart that I use on this post has a series &#8220;<strong>Series1</strong>&#8221; which has 3 data points &#8220;<strong>10,20,30</strong>&#8220;.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/1.png" target="_blank"><img title="Sample chart" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_1.png" alt="Sample chart" width="200" height="215" /></a></p>
<p><a href="#top">Back to top</a></p>
<p><a name="2"></a></p>
<h3>Change chart type</h3>
<p>There are many chart types that you can select for Chart control. On this example, I show some of those chart types which are Point, Line, Bar, Pie.</p>
<ol>
<li>On <strong>Chart Properties</strong>, click the <strong>Series</strong> collection. Then, click the ellipsis button.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/2.png" target="_blank"><img title="Chart Properties" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_2.png" alt="Chart Properties" width="200" height="282" /></a></li>
<li>On <strong>Series Collection Editor</strong>, select &#8220;<strong>Series1</strong>&#8221; in the Members area and change the <strong>Chart type</strong> property to <strong>Point</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/3.png" target="_blank"><img title="Change Chart Type" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_3.png" alt="Change Chart Type" width="200" height="147" /></a></li>
<li>The <strong>Point</strong> chart type.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/4.png" target="_blank"><img title="Point Chart" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_4.png" alt="Point Chart" width="200" height="215" /></a></li>
<li>The <strong>Line</strong> chart type.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/5.png" target="_blank"><img class=" alignnone" title="Line Chart" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_5.png" alt="Line Chart" width="200" height="215" /></a>
</li>
<li>The <strong>Bar</strong> chart type.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/6.png" target="_blank"><img title="Bar Chart" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_6.png" alt="Bar Chart" width="200" height="215" /></a></li>
<li>The <strong>Pie</strong> chart type.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/7.png" target="_blank"><img title="Pie Chart" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_7.png" alt="Pie Chart" width="200" height="215" /></a></li>
</ol>
<p><a href="#top">Back to top</a></p>
<p><a name="3"></a></p>
<h3>Change Color style of chart</h3>
<p>There are many color palettes that you can choose for Chart control. This section shows how to change color of Chart control.</p>
<ol>
<li>On <strong>Chart Properties</strong>, click on <strong>Palette</strong> property. You see a drop down button. Click on it and you can choose a color palette for your chart.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/8.png" target="_blank"><img title="Change Color Palette" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_8.png" alt="Change Color Palette" width="200" height="249" /></a></li>
<li>The example below is <strong>Bright</strong> color palette.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/9.png" target="_blank"><img title="Sample Chart" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_9.png" alt="Sample Chart" width="200" height="215" /></a>
</li>
</ol>
<p><a href="#top">Back to top</a></p>
<p><a name="4"></a></p>
<h3>Insert title to chart</h3>
<p>This section shows how to insert title to Chart control.</p>
<ol>
<li>On <strong>Chart Properties</strong>, click the <strong>Title</strong> collection. Then, click the ellipsis button.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/10.png" target="_blank"><img title="Chart Properties" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_10.png" alt="Chart Properties" width="200" height="249" /></a></li>
<li>On <strong>Title Collection Editor</strong>, click <strong>Add</strong> and set <strong>(Text)</strong> to &#8220;<strong>My Sample Chart</strong>&#8221; in the newly created Title object.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/11.png" target="_blank"><img title="Add Title" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_11.png" alt="Add Title" width="200" height="147" /></a></li>
<li>Run the project. You will see a title on top of the chart.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/12.png" target="_blank"><img title="Sample Chart with title" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_12.png" alt="Sample Chart with title" width="200" height="215" /></a></li>
<li>You can customize title&#8217;s text style, title position, title color on title properties.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/13.png" target="_blank"><img title="Title Properties" src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_13.png" alt="Title Properties" width="200" height="147" /></a></li>
</ol>
<p><a href="#top">Back to top</a></p>
<p><a name="5"></a></p>
<h3>3D chart</h3>
<p>This section shows how to use three-dimensional (3D) chart areas in Chart control.</p>
<ol>
<li>On <strong>Chart Properties</strong>, click the <strong>ChartAreas</strong> collection. Then, click the ellipsis button.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/14.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_14.png" width="200" height="249" alt="Open ChartArea Collection Editor" title="Open ChartArea Collection Editor"  /></a></li>
<li>On <strong>ChartArea Collection Editor</strong>, select &#8220;<strong>ChartArea1</strong>&#8220;. Expand <strong>Area3DStyle</strong> and change <strong>(Enable3D)</strong> to <strong>True</strong>.<br />
<em><strong>Note:</strong></em> You can customize your 3D Style on this <strong>Area3DStyle</strong> properties .<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/15.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_15.png" width="200" height="147" alt="Enable 3D Chart" title="Enable 3D Chart"  /></a></li>
<li>You see the chart is now 3D.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/16.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-2/_16.png" width="200" height="215" alt="Sample 3D Chart" title="Sample 3D Chart"  /></a></li>
</ol>
<p><a href="#top">Back to top</a></p>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 1: Basic Chart'>Creating Graph with VB.NET, Part 1: Basic Chart</a></li>
<li><a href='http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 3: Data Binding Chart to Database'>Creating Graph with VB.NET, Part 3: Data Binding Chart to Database</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<series:name><![CDATA[Creating Graph with VB.NET]]></series:name>
	</item>
		<item>
		<title>Creating Graph with VB.NET, Part 1: Basic Chart</title>
		<link>http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/</link>
		<comments>http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/#comments</comments>
		<pubDate>Tue, 11 May 2010 04:21:33 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Chart]]></category>
		<category><![CDATA[Dot Net]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=1148</guid>
		<description><![CDATA[This series shows how to create chart or graph with VB.NET using Microsoft Chart Controls for .NET Framework. I divide the series into 3 parts: Creating Graph with VB.NET, Part 1: Basic Chart Creating Graph with VB.NET, Part 2: Customize Chart Creating Graph with VB.NET, Part 3: Data Binding Chart to Database On this post, [...]


Related posts:<ol><li><a href='http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 2: Customize Chart'>Creating Graph with VB.NET, Part 2: Customize Chart</a></li>
<li><a href='http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 3: Data Binding Chart to Database'>Creating Graph with VB.NET, Part 3: Data Binding Chart to Database</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>This series shows how to create chart or graph with VB.NET using Microsoft Chart Controls for .NET Framework.</p>
<p><span id="more-1148"></span></p>
<p>I divide the series into 3 parts:</p>
<ol>
<li>Creating Graph with VB.NET, Part 1: Basic Chart</li>
<li>Creating Graph with VB.NET, Part 2: Customize Chart</li>
<li>Creating Graph with VB.NET, Part 3: Data Binding Chart to Database</li>
</ol>
<p><!--adsense#Square--></p>
<p>On this post, you will learn how to create a basic chart on Windows Form Application with VB.NET. I use Microsoft Visual Studio 2005 as IDE.</p>
<h3>Requirement</h3>
<ul>
<li>Microsoft Visual Studio 2005 or later.</li>
<li>.NET Framework 3.5 SP1 or later. You can download <a href="http://www.microsoft.com/downloads/details.aspx?familyid=AB99342F-5D1A-413D-8319-81DA479AB0D7&#038;displaylang=en" target="_blank" rel="nofollow">Microsoft .NET Framework 3.5 Service Pack 1</a> from Microsoft website.</li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&#038;displaylang=en" target="_blank" rel="nofollow">Microsoft Chart Controls for Microsoft .NET Framework 3.5</a></li>
</ul>
<h3>Step-by-step</h3>
<ol>
<li>Install the requirement software as stated on the Requirement section.</li>
<li>Open Microsoft Visual Studio 2005. Create a new VB.NET&#8217;s Windows Application. Type the name of the project as &#8220;<strong>SampleBasicChart</strong>&#8220;.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_1.png" width="200" height="122" alt="Create Windows Application's Project" title="Create Windows Application's Project"  /></a></li>
<li>On <strong>Toolbox</strong> window, drag a <strong>Chart</strong> control from the <strong>Data</strong> category to the Windows Form.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_2.png" width="200" height="188" alt="A Chart Control" title="A Chart Control"  /></a><br />
<strong><em>Note</em></strong>: If you does not see the Chart control in the Toolbox, you need to perform these steps below:</p>
<ul>
<li>Right-click on the <strong>Toolbox</strong> window and select <strong>Choose Items</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_3.png" width="200" height="158" alt="Add New Item to Toolbox" title="Add New Item to Toolbox"  /></a></li>
<li>On <strong>Choose Toolbox Items</strong>, click Browse.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/4.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_4.png" width="200" height="143" alt="Browse the Component" title="Browse the Component"  /></a></li>
<li>Browse to the location where you have installed Microsoft Chart Controls. The default location is<br />
C:\Program Files\Microsoft Chart Controls\Assemblies and select <strong>System.Windows.Forms.DataVisualization.dll</strong>. Then, click <strong>Open</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/5.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_5.png" width="200" height="131" alt="System.Windows.Forms.DataVisualization.dll" title="System.Windows.Forms.DataVisualization.dll"  /></a></li>
<li>You see Chart control has been added to .NET Framework Components. Verify that its check box is checked and click <strong>OK</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/6.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_6.png" width="200" height="143" alt="Chat Control Component" title="Chat Control Component"  /></a></li>
</ul>
</li>
<li>On <strong>Chart Properties</strong>, you see an empty chart with a default series, &#8220;<strong>Series1</strong>&#8220;. Next, I&#8217;m going to add another Series. On <strong>Chart Properties</strong>, click the <strong>Series</strong> collection. Then, click the ellipsis button.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/7.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_7.png" width="200" height="250" alt="Chart Properties" title="Chart Properties"  /></a></li>
<li>On <strong>Series Collection Editor</strong>, click <strong>Add</strong>. You will see &#8220;<strong>Series2</strong>&#8221; has been added to the collection.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/8.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_8.png" width="200" height="147" alt="Series Collection Editor" title="Series Collection Editor"  /></a></li>
<li>Now you have two series on a chart. But there is not any data on the chart so I will add some example data point on each series. Select <strong>Series1</strong> and click the ellipsis button on <strong>Points</strong> collection.
</li>
<li>On <strong>Series Collection Editor</strong>, select &#8220;<strong>Series1</strong>&#8221; in the <strong>Members</strong> area and click the <strong>Points</strong> collection property. Then, click the ellipsis button.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/9.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_9.png" width="200" height="147" alt="Add Data Points" title="Add Data Points"  /></a></li>
<li>On <strong>DataPoint Collection Editor</strong>, click <strong>Add</strong> and assign a value &#8220;<strong>10</strong>&#8221; to the <strong>YValues</strong> property in the newly created DataPoint object.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/10.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_10.png" width="200" height="147" alt="Set YValues on DataPoint" title="Set YValues on DataPoint"  /></a></li>
<li>Repeat step 8 to add two more DataPoint object with values &#8220;<strong>20</strong>&#8221; and &#8220;<strong>30</strong>&#8221; repectively. Then, click <strong>OK</strong> to close the <strong>DataPoint Collection Editor</strong> window.<br />
<em><strong>Note</strong></em>:  These values are example values, you may use any value as you want.</li>
<li>Repeat step 7-9 again on &#8220;<strong>Series2</strong>&#8221; with <strong>YValues</strong> as you want. Then, click <strong>OK</strong> to close the <strong>Series Collection Editor</strong> windows.</li>
<li>Run the project. You see the chart with two series as you created.<br />
<a href="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/11.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/Dot-Net/Chart-Control/Part-1/_11.png" width="200" height="215" alt="A Basic Chart" title="A Basic Chart"  /></a></li>
</ol>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2010/05/14/creating-graph-with-vb-net-part-2-customize-chart/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 2: Customize Chart'>Creating Graph with VB.NET, Part 2: Customize Chart</a></li>
<li><a href='http://www.linglom.com/2010/05/27/creating-graph-with-vb-net-part-3-data-binding-chart-to-database/' rel='bookmark' title='Permanent Link: Creating Graph with VB.NET, Part 3: Data Binding Chart to Database'>Creating Graph with VB.NET, Part 3: Data Binding Chart to Database</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/05/11/creating-graph-with-vb-net-part-1-basic-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<series:name><![CDATA[Creating Graph with VB.NET]]></series:name>
	</item>
		<item>
		<title>Accessing SQL Server on ASP.NET Web Application using ADO.NET</title>
		<link>http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/</link>
		<comments>http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 06:28:21 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=1089</guid>
		<description><![CDATA[ADO.NET is a set of components that can be used to access data and data services. The objects of ADO.NET that will be used in this post are: Connection: Provides a connection used to communicate with the data source. DataAdapter: A bridge used to transfer data between a Data source and a DataSet object. DataSet: [...]


Related posts:<ol><li><a href='http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data</a></li>
<li><a href='http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>ADO.NET is a set of components that can be used to access data and data services. The objects of ADO.NET that will be used in this post are:<span id="more-1089"></span></p>
<ul>
<li><strong>Connection</strong>: Provides a connection used to communicate with the data source.</li>
<li><strong>DataAdapter</strong>: A bridge used to transfer data between a Data source and a DataSet object.</li>
<li><strong>DataSet</strong>: Stores query result from DataAdapter.</li>
</ul>
<p><!--adsense#Square--></p>
<p>On this post, you will see how to develop an ASP.NET web application that query data from SQL Server 2005 and display the result on a GridView object. I have provided both VB.NET and C# programming languages.</p>
<h3>Step-by-step</h3>
<ol>
<li>Create a connection string in web.config. I decide to put the connection string in web.config so that I can re-use the connection string in other web form.

<div class="wp_syntax"><div class="code"><pre class="asp" style="font-family:monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>connectionstrings<span style="color: #006600; font-weight: bold;">&gt;</span>
		<span style="color: #006600; font-weight: bold;">&lt;</span>add name<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Northwind&quot;</span> 
       connectionString<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;Data Source=BKKSQL001\INSTANCE01;
       Initial Catalog=Northwind;
       Integrated Security=True&quot;</span> 
      providerName<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">&quot;System.Data.SqlClient&quot;</span><span style="color: #006600; font-weight: bold;">/&gt;</span>
<span style="color: #006600; font-weight: bold;">&lt;/</span>connectionstrings<span style="color: #006600; font-weight: bold;">&gt;</span></pre></div></div>

<p><strong>Attributes explanation:</strong></p>
<ul>
<li><strong>name</strong>: A connection string name.</li>
<li><strong>connectionString</strong>: A connection string which is used to connect to a database. On this example, it connects to Northwind database on BKKSQL001\INSTANCE01.</li>
<li><strong>providerName</strong>: A provider name that is used.</li>
</ul>
<p><a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/ADO.NET/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/ADO.NET/_1.png" width="200" height="150" alt="A Connection String" title="A Connection String"  /></a>
</li>
<li>On a Web Form, imports some namespaces which are required for working with SQL Server. System.Web.Configuration is use to read values from web.config.

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'Visual Basic</span>
<span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Data</span>
<span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Data</span>.<span style="color: #0000FF;">SqlClient</span>
<span style="color: #0600FF;">Imports</span> System.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">Configuration</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">//C#</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Data</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Data.SqlClient</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.Configuration</span><span style="color: #008000;">;</span></pre></div></div>

</li>
<li>Use a GridView object to display the query result. Set the name of GridView to &#8220;<strong>gridView1</strong>&#8220;. Copy and paste the code below to <strong>Page_Load</strong> method.

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'Visual Basic</span>
Protected <span style="color: #0600FF;">Sub</span> Page_Load<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">Load</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> connStr <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> <span style="color: #008000;">=</span> WebConfigurationManager.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Northwind&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">ConnectionString</span>
        <span style="color: #0600FF;">Dim</span> conn <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> SqlConnection<span style="color: #000000;">&#40;</span>connStr<span style="color: #000000;">&#41;</span>
        conn.<span style="color: #0600FF;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> sqlProducts <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;SELECT ProductID, ProductName, UnitPrice FROM Products&quot;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> da <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> SqlDataAdapter<span style="color: #000000;">&#40;</span>sqlProducts, conn<span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">Dim</span> ds <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">New</span> DataSet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        da.<span style="color: #0000FF;">Fill</span><span style="color: #000000;">&#40;</span>ds, <span style="color: #808080;">&quot;Products&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
        gridView1.<span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> ds.<span style="color: #0000FF;">Tables</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Products&quot;</span><span style="color: #000000;">&#41;</span>
        gridView1.<span style="color: #0000FF;">Databind</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">//C#</span>
<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">void</span> Page_Load<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> connStr <span style="color: #008000;">=</span> WebConfigurationManager.<span style="color: #0000FF;">ConnectionStrings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Northwind&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ConnectionString</span><span style="color: #008000;">;</span>
        SqlConnection conn <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> SqlConnection<span style="color: #000000;">&#40;</span>connStr<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        conn.<span style="color: #0000FF;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #FF0000;">string</span> sqlProducts <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;SELECT ProductID, ProductName, UnitPrice FROM Products&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        SqlDataAdapter da <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> SqlDataAdapter<span style="color: #000000;">&#40;</span>sqlProducts, conn<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        DataSet ds <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> DataSet<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        da.<span style="color: #0000FF;">Fill</span><span style="color: #000000;">&#40;</span>ds, <span style="color: #666666;">&quot;Products&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        gridView1.<span style="color: #0000FF;">DataSource</span> <span style="color: #008000;">=</span> ds.<span style="color: #0000FF;">Tables</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Products&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
        gridView1.<span style="color: #0000FF;">DataBind</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><strong>Code Explanation:</strong></p>
<ul>
<li>Line 4-6: Get a connection string value from web.config. Then, open a connection using the connection string to a SQL Server.</li>
<li>Line 8: Create a variable &#8220;<strong>sqlProducts</strong>&#8221; which stores SQL query from Products table.</li>
<li>Line 10-12: Create a SqlDataAdapter object &#8220;<strong>da</strong>&#8221; to execute the query. Then, create a DataSet object &#8220;<strong>ds</strong>&#8221; to hold the result from object &#8220;<strong>da</strong>&#8221; and set name to &#8220;<strong>Products</strong>&#8220;.</li>
<li>Line 14-15: Display data from object &#8220;<strong>ds</strong>&#8221; on a GridView object &#8220;<strong>gridView1</strong>&#8220;.</li>
</ul>
</li>
<li>Run the project. You will see the result as figure below.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/ADO.NET/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/ADO.NET/_2.png" width="200" height="247" alt="Northwind's Products table" title="Northwind's Products table"  /></a></li>
</ol>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data</a></li>
<li><a href='http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data</title>
		<link>http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/</link>
		<comments>http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 03:32:54 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SqlDataSource]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=1095</guid>
		<description><![CDATA[Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data From part 1: SELECT Data, you see how to query data from SQL Server 2005 to display on a GridView object using SqlDataSource web control. But the data is read-only, you cannot modify any data on a GridView. So now [...]


Related posts:<ol><li><a href='http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data</a></li>
<li><a href='http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using ADO.NET'>Accessing SQL Server on ASP.NET Web Application using ADO.NET</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><h3>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data</h3>
<p><span id="more-1095"></span></p>
<p>From <a href="http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/">part 1: SELECT Data</a>, you see how to query data from SQL Server 2005 to display on a GridView object using <strong>SqlDataSource</strong> web control. But the data is read-only, you cannot modify any data on a GridView. So now you will see how to modify data on the GridView which will update back on the database.</p>
<p><!--adsense#Square--></p>
<h3>Step-by-step</h3>
<p><em><strong>Note:</strong></em> This example is continue from part 1: SELECT Data.</p>
<ol>
<li>On SqlDataSource1, click on <strong>Configure Data Source</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_1.png" width="200" height="129" alt="Configure Data Source" title="Configure Data Source"  /></a></li>
<li>On <strong>Choose Your Data Connection</strong>, click <strong>Next</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_2.png" width="200" height="155" alt="Choose Your Data Connection" title="Choose Your Data Connection"  /></a></li>
<li>On <strong>Configure Select Statement</strong>, change the option from <strong>Specify columns from a table or view</strong> to <strong>Specify a custom SQL statement or stored procedure</strong>. Click <strong>Next</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_3.png" width="200" height="155" alt="Configure Select Statement" title="Configure Select Statement"  /></a></li>
<li>On <strong>Define Custom Statements or Stored Procedures</strong>, you see 4 tabs which are SELECT, UPDATE, INSERT and DELETE. Here you can define custom SQL statements for each SQL operations. On <strong>SELECT</strong> tab, enter the SQL statement as below:

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">&#91;</span>ProductID<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#91;</span>ProductName<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#91;</span>UnitPrice<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#91;</span>Products<span style="color: #66cc66;">&#93;</span></pre></div></div>

<p><a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/4.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_4.png" width="200" height="155" alt="Define Custom Statements or Stored Procedures" title="Define Custom Statements or Stored Procedures"  /></a></li>
<li>Click on <strong>UPDATE</strong> tab, enter the SQL statement below and click <strong>Next</strong>.

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> Products <span style="color: #993333; font-weight: bold;">SET</span> ProductName <span style="color: #66cc66;">=</span> @ProductName<span style="color: #66cc66;">,</span> UnitPrice <span style="color: #66cc66;">=</span> @UnitPrice
<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #66cc66;">&#91;</span>ProductID<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> @ProductID</pre></div></div>

<p><a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/5.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_5.png" width="200" height="155" alt="Update SQL Query" title="Update SQL Query"  /></a></li>
<li>On <strong>Test Query</strong>, Click <strong>Finish</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/6.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_6.png" width="200" height="155" alt="Test Query" title="Test Query"  /></a></li>
<li>On <strong>GridView1</strong>, click <strong>Edit Columns</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/7.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_7.png" width="200" height="129" alt="Edit Columns" title="Edit Columns"  /></a></li>
<li>On <strong>Fields</strong>, select <strong>Command Fields</strong> -> <strong>Edit, Update, Cancel</strong> on <strong>Available fields</strong> and click <strong>Add</strong>. Then, move the field <strong>Edit, Update, Cancel</strong> to the top by click on up arrow button. Next, click <strong>OK</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/8.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_8.png" width="200" height="163" alt="Add Fields on Grid View Web Control" title="Add Fields on Grid View Web Control"  /></a></li>
<li>On <strong>GridView1</strong>, check <strong>Enable Editing</strong> to allow edit data on the Grid View.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/9.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_9.png" width="200" height="129" alt="Enable Editing" title="Enable Editing"  /></a></li>
<li>Build and run the project. You see the <strong>Edit</strong> column in front of each row. Click <strong>Edit</strong> to edit the row.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/10.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_10.png" width="200" height="273" alt="Query Result" title="Query Result"  /></a></li>
<li>You can modify the value of product name and unit price of the row which also update back on the database, too.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/11.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-2/_11.png" width="200" height="195" alt="Edit a Row" title="Edit a Row"  /></a></li>
</ol>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data</a></li>
<li><a href='http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using ADO.NET'>Accessing SQL Server on ASP.NET Web Application using ADO.NET</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data</title>
		<link>http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/</link>
		<comments>http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 04:40:26 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[SqlDataSource]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=1092</guid>
		<description><![CDATA[Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data On this post, you will see how to develop an ASP.NET web application that query data from SQL Server 2005 and display the result on a GridView object using SqlDataSource web control so you don&#8217;t have to write any code! [...]


Related posts:<ol><li><a href='http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data</a></li>
<li><a href='http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using ADO.NET'>Accessing SQL Server on ASP.NET Web Application using ADO.NET</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><h3>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 1: SELECT Data</h3>
<p><span id="more-1092"></span></p>
<p>On this post, you will see how to develop an ASP.NET web application that query data from SQL Server 2005 and display the result on a GridView object using <strong>SqlDataSource</strong> web control so you don&#8217;t have to write any code!</p>
<p><!--adsense#Square--></p>
<h3>Step-by-step-</h3>
<ol>
<li>Drag a <strong>SqlDataSource</strong> object from Toolbox to a Web Form.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_1.png" width="200" height="233" alt="SqlDataSource" title="SqlDataSource"  /></a></li>
<li>On <strong>SqlDataSource1</strong> object, click <strong>Configure Data Source</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_2.png" width="200" height="129" alt="Configure Data Source" title="Configure Data Source"  /></a></li>
<li>On <strong>Choose Your Data Connection</strong>, click <strong>New Connection</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_3.png" width="200" height="155" alt="Create a New Connection" title="Create a New Connection"  /></a></li>
<li>On <strong>Add Connection</strong>, select <strong>Data Source</strong> as <strong>Microsoft SQL Server (SqlClient)</strong>. Then, type the Server name of the SQL Server and select a database. On this example, the server is <strong>BKKSQL001\INSTANCE01</strong> and <strong>Northwind</strong> is the database.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/4.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_4.png" width="200" height="301" alt="Add Connection" title="Add Connection"  /></a></li>
<li>On <strong>Save the Connection String to the Application Configuration File</strong>, click <strong>Next</strong> to continue.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/5.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_5.png" width="200" height="155" alt="Save the Connection String" title="Save the Connection String"  /></a></li>
<li>On <strong>Configure the Select Statement</strong>, select <strong>Specify columns from table or view</strong> and select <strong>Products</strong> table. Then, check <strong>ProductID</strong>, <strong>ProductName</strong> and <strong>UnitPrice</strong> columns. Click <strong>Next</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/6.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_6.png" width="200" height="155" alt="Configure the Select Statement" title="Configure the Select Statement"  /></a></li>
<li>On <strong>Test Query</strong>, you can click on <strong>Test Query</strong> button to verify the query result. Then, click <strong>Finish</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/7.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_7.png" width="200" height="155" alt="Test Query" title="Test Query"  /></a></li>
<li>Drag a GridView object from Toolbox to the Web Form. Then, choose the Data Source to the one that you have just created.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/8.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_8.png" width="200" height="129" alt="Set Data Source for GridView Object" title="Set Data Source for GridView Object"  /></a></li>
<li>Build and run the project. You will see the result as the figure below.<br />
<a href="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/9.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Programming/ASP.NET/Access-SQLServer/SqlDataSource/Part-1/_9.png" width="200" height="247" alt="Query Result on Web Page" title="Query Result on Web Page"  /></a></li>
</ol>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2010/04/02/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-2-update-data/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data'>Accessing SQL Server on ASP.NET Web Application using SqlDataSource Web Control, Part 2: UPDATE Data</a></li>
<li><a href='http://www.linglom.com/2010/04/14/accessing-sql-server-on-asp-net-web-application-using-ado-net/' rel='bookmark' title='Permanent Link: Accessing SQL Server on ASP.NET Web Application using ADO.NET'>Accessing SQL Server on ASP.NET Web Application using ADO.NET</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/03/26/accessing-sql-server-on-asp-net-web-application-using-sqldatasource-web-control-part-1-select-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Enable SSH on VMWare ESXi Server 3.5</title>
		<link>http://www.linglom.com/2010/03/13/how-to-enable-ssh-on-vmware-esxi-server-3-5/</link>
		<comments>http://www.linglom.com/2010/03/13/how-to-enable-ssh-on-vmware-esxi-server-3-5/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 08:48:27 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[VMWare]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[SSH]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=629</guid>
		<description><![CDATA[Introduction By default, SSH is disabled on VMWare ESXi Server but you can enable SSH manually. It&#8217;s easy, just take a few minutes and few steps to enable SSH. On this example, I am going to show how to enable SSH on VMWare ESXi Server 3.5 on HP ProLiant BL25p G2. Step-by-step On VMWare ESXi [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><h3>Introduction</h3>
<p>By default, SSH is disabled on VMWare ESXi Server but you can enable SSH manually. It&#8217;s easy, just take a few minutes and few steps to enable SSH. On this example, I am going to show how to enable SSH on VMWare ESXi Server 3.5 on HP ProLiant BL25p G2.</p>
<p><span id="more-629"></span></p>
<p><!--adsense#Square--></p>
<h3>Step-by-step</h3>
<ol>
<li>On VMWare ESXi Server, press &#8220;<strong>ALT+F1</strong>&#8221; to access VMWare ESXi console.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/1.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_1.png" width="250" height="191" alt="VMWare ESXi Server 3.5 Screen" title="VMWare ESXi Server 3.5 Screen"  /></a></li>
<li>By default, VMWare ESXi is disabled console access. So you have to enable it by type the following text and press <strong>Enter</strong>.

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">unsupported</pre></div></div>

<p><em><strong>Note:</strong></em> You won&#8217;t see the text that you have typed on this step.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/2.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_2.png" width="250" height="190" alt="Enter VMWare ESXi Server's Console" title="Enter VMWare ESXi Server's Console"  /></a></li>
<li>If you type the text correctly, there&#8217;ll be a message tells that

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">You have activated Tech Support Mode.
The time and date of this activation have been sent to the system logs.</pre></div></div>

<p>Then, it asks for the root&#8217;s password so type the password of the root account and press <strong>Enter</strong>.<br />
<em><strong>Note:</strong></em> You also won&#8217;t see the text that you have typed on this step either.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/3.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_3.png" width="250" height="191" alt="Type Root's Password" title="Type Root's Password"  /></a></li>
<li>Now you have accessed to console on VMWare ESXi. Notice that you see &#8220;~ #&#8221; at the beginning which means that the console is waiting for a command from you.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/4.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_4.png" width="250" height="73" alt="Console on VMWare ESXi Server" title="Console on VMWare ESXi Server"  /></a></li>
<li>To enable SSH, you have to edit /etc/inetd.conf. Type the command below in the console.

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">vi /etc/inetd.conf</pre></div></div>

<p><em><strong>Note:</strong></em> vi is the file editor tool in Linux platform as similar to Notepad in Windows.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/5.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_5.png" width="250" height="35" alt="Edit inetd.conf" title="Edit inetd.conf"  /></a></li>
<li>Here, you see the content of inetd.conf.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/6.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_6.png" width="250" height="191" alt="inetd.conf" title="inetd.conf"  /></a></li>
<li>Scroll down to the line that begins with the following text.

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">#ssh   stream   tcp   nowait   root   /sbin/dropbearmulti   dropbear</pre></div></div>

<p>Then, press the character &#8216;x&#8217; when the cursor is on the character &#8216;#&#8217; to remove &#8216;#&#8217; as the figure below.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ssh   stream   tcp   nowait   root   /sbin/dropbearmulti   dropbear</pre></div></div>

<p><em><strong>Note:</strong></em> The character &#8216;#&#8217; at the beginning on a line means that the line is a comment, the program that associated with the file will not process the line.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/7.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_7.png" width="250" height="191" alt="Edit Config File to Enable SSH" title="Edit Config File to Enable SSH"  /></a></li>
<li>Next, save the file by press <strong>ESC</strong>. Then, type

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">:wq!</pre></div></div>

<p> and press <strong>Enter</strong> to save and exit the file editor at the same time.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/8.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_8.png" width="250" height="91" alt="Save the File" title="Save the File"  /></a></li>
<li>Next, restart the management service. Type

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/sbin/services.sh restart</pre></div></div>

<p><em><strong>Note:</strong></em> Since VMWare ESXi 3.5 Update 2, the &#8220;/sbin/services.sh restart&#8221; command is no longer restarts the inetd process so the configuration that you&#8217;ve just modified is not reflect to the system yet. Therfore, you need to do more steps.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/9.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_9.png" width="250" height="46" alt="Restart the Management Service" title="Restart the Management Service"  /></a></li>
<li>Next, you need to kill the inetd process. First, you have to get the process id of inetd. Type the command below, you&#8217;ll see the process ID of inetd.

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ps | grep inetd</pre></div></div>

<p><a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/10.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_10.png" width="250" height="24" alt="View Existing inetd's Process" title="View Existing inetd's Process"  /></a></li>
<li>Kill the process. Type the command &#8220;kill -HUP&#8221; follow with the process ID that you get from the previous step as the figure below.

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">kill -HUP 1288</pre></div></div>

<p><em><strong>Note:</strong></em> The process ID of inetd of yours may not be the same as mine. You have to adjust by yourself.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/11.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_11.png" width="250" height="16" alt="Kill the inetd's Process" title="Kill the inetd's Process"  /></a></li>
<li>That&#8217;s it. You have enabled SSH on VMWare ESXi Server already. Now you can SSH to the VMWare ESXi Server using tool such as putty, WinSCP, etc. Type the command below to exit the console.

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">exit</pre></div></div>

<p><a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/12.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_12.png" width="250" height="16" alt="Exit the Console" title="Exit the Console"  /></a></li>
<li>Then, press &#8220;<strong>Alt+F2</strong>&#8221; to return to the GUI screen.<br />
<a href="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/13.png" target="_blank"><img src="http://www.linglom.com/images/virtualization/VMWare/ESXi-Server/Enable-SSH/_13.png" width="250" height="191" alt="Return to GUI Screen" title="Kill the inetd's Process"  /></a></li>
</ol>
</div>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/03/13/how-to-enable-ssh-on-vmware-esxi-server-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Microsoft ISA Server 2006, Part 12: Block Windows Live Messenger</title>
		<link>http://www.linglom.com/2010/02/24/getting-started-with-microsoft-isa-server-2006-part-12-block-windows-live-messenger/</link>
		<comments>http://www.linglom.com/2010/02/24/getting-started-with-microsoft-isa-server-2006-part-12-block-windows-live-messenger/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 02:28:32 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[ISA]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Getting Started]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=977</guid>
		<description><![CDATA[This article is one of the series of Getting started with Microsoft ISA Server 2006. You can see the index of this series at Getting started with Microsoft ISA Server 2006, Part 1: Introduction. Block Windows Live Messenger From Part 11: HTTP Filtering, you learn about HTTP filtering concept. Now let&#8217;s apply it with a [...]


Related posts:<ol><li><a href='http://www.linglom.com/2008/02/01/getting-started-with-microsoft-isa-server-2006-part-v-configure-http-filter/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter'>Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter</a></li>
<li><a href='http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part 11: HTTP Filtering'>Getting started with Microsoft ISA Server 2006, Part 11: HTTP Filtering</a></li>
<li><a href='http://www.linglom.com/2009/08/21/getting-started-with-microsoft-isa-server-2006-part-1-introduction/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part 1: Introduction'>Getting started with Microsoft ISA Server 2006, Part 1: Introduction</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>This article is one of the series of Getting started with Microsoft ISA Server 2006. You can see the index of this series at <a href="http://www.linglom.com/2009/08/21/getting-started-with-microsoft-isa-server-2006-part-1-introduction/">Getting started with Microsoft ISA Server 2006, Part 1: Introduction</a>.</p>
<p><span id="more-977"></span></p>
<h3>Block Windows Live Messenger</h3>
<p>From <a href="http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/">Part 11: HTTP Filtering</a>, you learn about HTTP filtering concept. Now let&#8217;s apply it with a real world example, <strong>Windows Live Messenger</strong>. On this post, I show you how to block Windows Live Messenger on ISA Server 2006. </p>
<p><!--adsense#Square--></p>
<p>Windows Live Messenger is a popular instant messaging application, many people using it regularly. But sometimes, people use it at work place and unintentionally receive a file containing virus. Then, they execute it, so the virus spread on the network. Therefore, it is a task of an IT staff to secure the system and prevent this issue. The best and effective solution is to enforce strictly firewall policy. But sometimes, you cannot do that. For example, users on research department want access to any websites (HTTP) because they do not know what websites they want to access until they need. Then, you have to create an access rule to allow HTTP to from Internal to External for these users. Now they can use Windows Live Messenger because Windows Live Messenger communicates with its servers through either of these ports:</p>
<ul>
<li>MSN Messenger protocol (TCP: 1863).</li>
<li>HTTP protocol (TCP: 80).</li>
</ul>
<p>If you block only MSN Messenger protocol, users still can use Windows Live Messenger through HTTP protocol. Now what should you do? Block HTTP protocol? Doing that will also block users to access websites so you cannot do that. Here it comes, HTTP filtering. You can block only Windows Live Messenger on ISA Server without blocking the HTTP protocol if you know the signature. HTTP header is also the signature.</p>
<p>So what is the signature of Windows Live Messenger? I have sniffed HTTP packets while I signing to Windows Live Messenger. Here are the signature and protocol port of Windows Live Messenger:</p>
<ul>
<li>The client communicates with the server of Windows Live Messenger using <strong>TCP outbound port 1863</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_1.png" width="200" height="49" alt="Windows Live Messenger TCP Packets" title="Windows Live Messenger TCP Packets"  /></a></li>
<li>While the client requesting information from the server (request header), one signature of it is <strong>User-Agent: Windows Live Messenger</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_2.png" width="200" height="51" alt="User-Agent: Windows Live Messenger HTTP packet" title="User-Agent: Windows Live Messenger HTTP packet"  /></a></li>
</ul>
<p>Now I show you how to configure to block Windows Live Messenger on ISA Server 2006.</p>
<h3>Step-by-step</h3>
<ol>
<li>Create an access rule to block TCP outbound port 1863. ISA Server 2006 already has pre-defined this port as <strong>MSN Messenger</strong> protocol. I am not going to show detail steps on creating an access rule. You can review them at <a href="http://localhost/wordpress/2009/07/29/getting-started-with-microsoft-isa-server-2006-part-7-create-dns-lookup-rule/">Part 7: Create DNS Lookup Rule</a> and <a href="http://localhost/wordpress/2009/07/17/getting-started-with-microsoft-isa-server-2006-part-8-create-web-access-rule/">Part 8: Create Web Access Rule</a>.
<ul>
<li>Rule Name: <strong>Block Windows Live Messenger</strong></li>
<li>Action: <strong>Deny</strong></li>
<li>Protocol: <strong>MSN Messenger</strong></li>
<li>From: <strong>Internal</strong></li>
<li>To: <strong>External</strong></li>
<li>Condition: <strong>All Users</strong></li>
</ul>
<p><a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_3.png" width="200" height="123" alt="Create Access Rule to Block MSN Messenger Protocol" title="Create Access Rule to Block MSN Messenger Protocol"  /></a></li>
<li>Next, configure HTTP filtering to block the signature of Windows Live Messenger. Right click on <strong>&#8220;Allow HTTP, HTTPS for Linglom&#8221;</strong> and select <strong>Configure HTTP</strong>.<br />
<em><strong>Note:</strong></em> This menu option available on an access rule that contains HTTP protocol only.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/4.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_4.png" width="200" height="114" alt="Configure HTTP" title="Configure HTTP"  /></a></li>
<li>On <strong>Configure HTTP policy for rule</strong>, click on <strong>Signatures</strong> tab and click <strong>Add</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/5.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_5.png" width="200" height="222" alt="Add Signature to Rule" title="Add Signature to Rule"  /></a></li>
<li>On <strong>Signature</strong>, enter these information below to block Windows Live Messenger and then click <strong>OK</strong>.
<ul>
<li>Name: <strong>Blocks Windows Live Messenger</strong> or any name as you want.</li>
<li>Search in: <strong>Request headers</strong></li>
<li>HTTP header: <strong>User-Agent:</strong></li>
<li>Signature: <strong>Windows Live Messenger</strong></li>
</ul>
<p><em><strong>Note:</strong></em> Don&#8217;t forget semi-colon (:) after <strong>User-Agent</strong> text.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/6.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_6.png" width="200" height="204" alt="The Signature of Windows Live Messenger" title="The Signature of Windows Live Messenger"  /></a></li>
<li>Back to <strong>Configure HTTP policy for rule</strong>, you see the signature has been created for this rule. You also can disable the signature by un-check it. On this example, leave it as checked to enable the signature. Click <strong>OK</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/7.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_7.png" width="200" height="222" alt="Blocks Windows Live Messenger" title="Blocks Windows Live Messenger"  /></a></li>
<li>Don&#8217;t forget to click <strong>Apply</strong> to update the configuration.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/8.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_8.png" width="200" height="114" alt="Apply Configurations" title="Apply Configurations"  /></a></li>
<li>Let&#8217;s try to sign in Windows Live Messenger on the client computer, you see that I cannot sign in any more.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/9.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-12/_9.png" width="200" height="263" alt="Can't Sign in on Windows Live Messenger" title="Can't Sign in on Windows Live Messenger"  /></a></li>
</ol>
<h3>Summary</h3>
<p>Now You have reach the end of <strong>Getting started with Microsoft ISA Server 2006</strong> series. This series contains 12 parts: it gives you an introduction of ISA Server 2006, how to install and configure ISA Server 2006 on simple environment, how to create an access rule, and how to use some useful features on ISA Server 2006. I hope you get what you want on this series. If you have any comment or suggestion, feel free to leave it below.</p>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2008/02/01/getting-started-with-microsoft-isa-server-2006-part-v-configure-http-filter/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter'>Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter</a></li>
<li><a href='http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part 11: HTTP Filtering'>Getting started with Microsoft ISA Server 2006, Part 11: HTTP Filtering</a></li>
<li><a href='http://www.linglom.com/2009/08/21/getting-started-with-microsoft-isa-server-2006-part-1-introduction/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part 1: Introduction'>Getting started with Microsoft ISA Server 2006, Part 1: Introduction</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/02/24/getting-started-with-microsoft-isa-server-2006-part-12-block-windows-live-messenger/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting started with Microsoft ISA Server 2006, Part 11: HTTP Filtering</title>
		<link>http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/</link>
		<comments>http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 02:58:03 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[ISA]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Getting Started]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=975</guid>
		<description><![CDATA[This article is one of the series of Getting started with Microsoft ISA Server 2006. You can see the index of this series at Getting started with Microsoft ISA Server 2006, Part 1: Introduction. HTTP Filtering From Part 10: Logging, you learn how to configure and use logging on ISA Server 2006. Now, you will [...]


Related posts:<ol><li><a href='http://www.linglom.com/2008/02/01/getting-started-with-microsoft-isa-server-2006-part-v-configure-http-filter/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter'>Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter</a></li>
<li><a href='http://www.linglom.com/2010/02/24/getting-started-with-microsoft-isa-server-2006-part-12-block-windows-live-messenger/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part 12: Block Windows Live Messenger'>Getting started with Microsoft ISA Server 2006, Part 12: Block Windows Live Messenger</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p>This article is one of the series of Getting started with Microsoft ISA Server 2006. You can see the index of this series at <a href="http://www.linglom.com/2009/08/21/getting-started-with-microsoft-isa-server-2006-part-1-introduction/">Getting started with Microsoft ISA Server 2006, Part 1: Introduction</a>.</p>
<p><span id="more-975"></span></p>
<h3>HTTP Filtering</h3>
<p>From <a href="http://www.linglom.com/2010/02/05/getting-started-with-microsoft-isa-server-2006-part-10-logging/">Part 10: Logging</a>, you learn how to configure and use logging on ISA Server 2006. Now, you will learn about HTTP filtering.</p>
<p><!--adsense#Square--></p>
<p>Have you ever want to block users using MSN or Yahoo messenger, or deny them to using free email services, or block them to post anything on web boards, or block them to use bit-torrent to download files? This post will answer these questions with Microsoft ISA Server 2006.</p>
<p>HTTP traffic is a data packet using HTTP protocol on the network which is used by most applications. On each packet of HTTP traffic, there is a header which contains information about server and client that are communicating each other at the time. These header information are such as:</p>
<ul>
<li>Request Methods. For example, GET, POST, CONNECT.</li>
<li>User-Agent, such as Mozilla/4.0, Mozilla/5.0, Firefox</li>
<li>Content-Type. The mime type of the body of the request, such as application/x-www-form-urlencoded, application/xml, image/jpeg, text/xml.</li>
<li>Host. The domain name of the server, for example, www.bing.com, www.linglom.com.</li>
</ul>
<p>For more information about HTTP, see these links from wiki.org: </p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/HTTP" target="_blank rel="nofollow">Hypertext Transfer Protocol</a></li>
<li><a href="http://en.wikipedia.org/wiki/List_of_HTTP_headers" target="_blank rel="nofollow">Lists of HTTP headers</a></li>
</ul>
<p>So why learn about these HTTP headers? You can use these HTTP headers information to block or allow specific application on ISA Server 2006. Still not get it? Let&#8217;s see some examples of real HTTP traffic.</p>
<p>You can use some sniffer program to capture data packets that pass in/out through a network interface card on a computer. On this example, I use <a href="http://www.ethereal.com/" target="_blank" rel="nofollow">Ethereal</a>. I install it on the same server as ISA Server 2006 but you can install and test on any computer as you want. Then, I start capturing packets on the network interface card that connects to the Internet and browse to http://www.bing.com using Internet Explorer.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-11/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-11/_1.png" width="200" height="150" alt="Browse to Bing.com" title="Browse to Bing.com"  /></a></p>
<p>After that, I see these HTTP traffics on ethereal. First, My computer sends a HTTP request to the web server (www.bing.com).<br />
<strong>Detail:</strong> Request Method is <strong>GET</strong>. User-Agent is Mozilla/4.0 (compatible: MSIE 6.0). HOST is <strong>www.bing.com</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-11/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-11/_2.png" width="200" height="54" alt="HTTP Request" title="HTTP Request"  /></a></p>
<p>Second, the web server has send HTTP response back to the client. The response packet looks similar as the figure below.<br />
<strong>Detail:</strong> Response Code is <strong>200 (OK)</strong>. Content-Type is <strong>text/html</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-11/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-11/_3.png" width="200" height="97" alt="HTTP Response" title="HTTP Response"  /></a></p>
<h3>What&#8217;s Next?</h3>
<p>Now you learn some concepts about HTTP and its header. Next, I will show how to use these information to block Windows Live Messenger on ISA Server 2006. See <a href="http://www.linglom.com/2010/02/24/getting-started-with-microsoft-isa-server-2006-part-12-block-windows-live-messenger/">Part 12: Block Windows Live Messenger</a>. </p>
</div>

<p>Related posts:<ol><li><a href='http://www.linglom.com/2008/02/01/getting-started-with-microsoft-isa-server-2006-part-v-configure-http-filter/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter'>Getting started with Microsoft ISA Server 2006, Part V: Configure HTTP Filter</a></li>
<li><a href='http://www.linglom.com/2010/02/24/getting-started-with-microsoft-isa-server-2006-part-12-block-windows-live-messenger/' rel='bookmark' title='Permanent Link: Getting started with Microsoft ISA Server 2006, Part 12: Block Windows Live Messenger'>Getting started with Microsoft ISA Server 2006, Part 12: Block Windows Live Messenger</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with Microsoft ISA Server 2006, Part 10: Logging</title>
		<link>http://www.linglom.com/2010/02/05/getting-started-with-microsoft-isa-server-2006-part-10-logging/</link>
		<comments>http://www.linglom.com/2010/02/05/getting-started-with-microsoft-isa-server-2006-part-10-logging/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 09:04:25 +0000</pubDate>
		<dc:creator>linglom</dc:creator>
				<category><![CDATA[ISA]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Getting Started]]></category>

		<guid isPermaLink="false">http://www.linglom.com/?p=973</guid>
		<description><![CDATA[This article is one of the series of Getting started with Microsoft ISA Server 2006. You can see the index of this series at Getting started with Microsoft ISA Server 2006, Part 1: Introduction. Logging From Part 9: Client Configuration, you learn how to configure a client computer. On this post, I will show how [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="KonaBody"><p><a name="top"></a><br />
This article is one of the series of Getting started with Microsoft ISA Server 2006. You can see the index of this series at <a href="http://www.linglom.com/2009/08/21/getting-started-with-microsoft-isa-server-2006-part-1-introduction/">Getting started with Microsoft ISA Server 2006, Part 1: Introduction</a>.</p>
<p><span id="more-973"></span></p>
<h3>Logging</h3>
<p>From <a href="http://www.linglom.com/2009/11/25/getting-started-with-microsoft-isa-server-2006-part-9-client-configuration/">Part 9: Client Configuration</a>, you learn how to configure a client computer. On this post, I will show how to use logging to observe usage which is a feature on ISA Server 2006 which keeps track any usage on ISA Server 2006. </p>
<p><!--adsense#Square--></p>
<p>When there is a communication between networks (Internal, External, Localhost, etc.) on the ISA Server, it will generate log. The log shows the log time, source IP address, destination IP address and port, action, rule applied to, etc. You can configure what fields that you want to log. There are three log storage formats supported on ISA Server 2006: MSDE database, SQL database and file.</p>
<p>The benefits of logging:</p>
<ul>
<li>Track usage on certain users, groups.</li>
<li>Troubleshoot issues on the ISA Server.</li>
<li>Keep as Internet access log. In some countries, it is require to keep the Internet access log in order to comply with the law.</li>
</ul>
<h3>Step-by-step</h3>
<h4>Logging Configuration</h4>
<p>Actually, there is no need to configure logging on ISA Server 2006 because the configuration works great on default settings already. </p>
<ol>
<li>Open Logging by expand <strong>Arrays</strong> -> <strong>BKKISA001</strong> -> <strong>Monitoring</strong>. Click on <strong>Logging</strong> tab.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/1.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_1.png" width="200" height="127" alt="ISA Server Logging" title="ISA Server Logging"  /></a></li>
<li>To configure firewall logging, select <strong>Tasks</strong> -> <strong>Configure Firewall Logging</strong>.<br />
<em><strong>Note: </strong></em>You also can configure web proxy logging by click on <strong>Configure Web Proxy Logging</strong>. The configuration is the same as firewall logging so I will not repeat it.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/2.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_2.png" width="200" height="142" alt="Configure Firewall Logging" title="Configure Firewall Logging"  /></a></li>
<li>On <strong>Firewall Logging Properties</strong>, you can choose to keep log on MSDE, SQL Server or a file. The default configuration is MSDE database and the default location is C:\Program Files\Microsoft ISA Server\ISALogs. Let&#8217;s click on <strong>Options</strong> next to MSDE database to see what can be configured for MSDE database.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/3.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_3.png" width="200" height="222" alt="Firewall Logging Properties" title="Firewall Logging Properties"  /></a></li>
<li>On <strong>Options</strong>, you see that you can change location to store the log files and the log file storage limitation. You can limit the size of log files, maintain disk space by deleting the older log files or discard new entries and whether you want to delete log files after period of time.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/4.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_4.png" width="200" height="248" alt="Log MSDE Database Options" title="Log MSDE Database Options"  /></a></li>
<li>Back to <strong>Firewall Logging Properties</strong>, there is another tab, <strong>Fields</strong>. Here you can customize which fields you want to keep or discard on log files. Normally, you don&#8217;t have to modify these configuration. It works perfect by default.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/5.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_5.png" width="200" height="222" alt="Log Fields" title="Log Fields"  /></a></li>
</ol>
<h4>Observe Logging</h4>
<ol>
<li>On <strong>Logging</strong>, click on <strong>Start Query</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/6.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_6.png" width="200" height="137" alt="Start Query" title="Start Query"  /></a></li>
<li>Generate some traffic by access the Internet on the client computer. Open web browser and browse to www.google.com.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/7.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_7.png" width="200" height="150" alt="Access the Internet" title="Access the Internet"  /></a></li>
<li>Now you see some logs on the ISA Server 2006.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/8.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_8.png" width="200" height="137" alt="Logging on ISA Server 2006" title="Logging on ISA Server 2006"  /></a></li>
<li>You can filter logging on ISA Server 2006 by click on <strong>Edit Filter</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/9.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_9.png" width="200" height="137" alt="Open Edit Filter" title="Open Edit Filter"  /></a></li>
<li>On <strong>Edit Filter</strong>, modify columns and conditions as you want. Then, click <strong>Start Query</strong>.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/10.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_10.png" width="200" height="178" alt="Edit Filter" title="Edit Filter"  /></a></li>
<li>This is an example of the filtered logs on ISA Server 2006.<br />
<a href="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/11.png" target="_blank"><img src="http://www.linglom.com/images/Windows/Security/ISA-Server/Getting-Started/Part-10/_11.png" width="200" height="136" alt="The Filtered Result" title="The Filtered Result"  /></a></li>
</ol>
<h3>What&#8217;s Next?</h3>
<p>Now you learn how to observe logging on ISA Server 2006. It is a useful feature which allow you to troubleshoot issues most of the time. Next, I will show more advance topic, HTTP filtering. See <a href="http://www.linglom.com/2010/02/17/getting-started-with-microsoft-isa-server-2006-part-11-http-filtering/">Part 11: HTTP Filtering</a>.</p>
</div>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.linglom.com/2010/02/05/getting-started-with-microsoft-isa-server-2006-part-10-logging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 5.666 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-31 18:33:54 -->
