<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>SranKamal's Blog</title>
	<atom:link href="http://mysolution4dotnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysolution4dotnet.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 02 Jul 2009 08:40:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mysolution4dotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SranKamal's Blog</title>
		<link>http://mysolution4dotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mysolution4dotnet.wordpress.com/osd.xml" title="SranKamal&#039;s Blog" />
	<atom:link rel='hub' href='http://mysolution4dotnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Get Contact List from yahoo</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/07/02/get-contact-list-from-yahoo/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/07/02/get-contact-list-from-yahoo/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 08:40:13 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[yahoo Contact List]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/?p=42</guid>
		<description><![CDATA[using following code you can get contact list from any yahoo id. using System; using System.Collections.Specialized; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Collections; public partial class YahooContact : System.Web.UI.Page { private const string _addressBookUrl = &#8220;http://address.yahoo.com/yab/us/Yahoo_ab.csv?loc=us&#38;.rand=1671497644&#38;A=H&#38;Yahoo_ab.csv&#8221;; private const string _authUrl = &#8220;https://login.yahoo.com/config/login?&#8221;; private const string _loginPage = &#8220;https://login.yahoo.com/config/login&#8221;; private const string _userAgent = &#8220;Mozilla/5.0 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=42&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>using following code you can get contact list from any yahoo id.</p>
<p>using System;<br />
using System.Collections.Specialized;<br />
using System.Net;<br />
using System.Text;<br />
using System.Text.RegularExpressions;<br />
using System.Collections;</p>
<p>public partial class YahooContact : System.Web.UI.Page<br />
{<br />
private const string _addressBookUrl = &#8220;http://address.yahoo.com/yab/us/Yahoo_ab.csv?loc=us&amp;.rand=1671497644&amp;A=H&amp;Yahoo_ab.csv&#8221;;<br />
private const string _authUrl = &#8220;https://login.yahoo.com/config/login?&#8221;;<br />
private const string _loginPage = &#8220;https://login.yahoo.com/config/login&#8221;;<br />
private const string _userAgent = &#8220;Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3&#8243;;<br />
private string username = string.Empty;<br />
private string password = string.Empty;</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
{</p>
<p>}<br />
private ArrayList Extract(string uname, string upass)<br />
{<br />
bool result = false;<br />
ArrayList myarray = new ArrayList();</p>
<p>//list = New MailContactList()</p>
<p>try<br />
{<br />
WebClient webClient = new WebClient();<br />
webClient.Headers[HttpRequestHeader.UserAgent] = _userAgent;<br />
webClient.Encoding = Encoding.UTF8;</p>
<p>byte[] firstResponse = webClient.DownloadData(_loginPage);<br />
string firstRes = Encoding.UTF8.GetString(firstResponse);</p>
<p>NameValueCollection postToLogin = new NameValueCollection();<br />
Regex regex = new Regex(&#8220;type=\&#8221;hidden\&#8221; name=\&#8221;(.*?)\&#8221; value=\&#8221;(.*?)\&#8221;", RegexOptions.IgnoreCase);<br />
Match match = regex.Match(firstRes);<br />
while (match.Success)<br />
{<br />
if (match.Groups[0].Value.Length &gt; 0)<br />
{<br />
postToLogin.Add(match.Groups[1].Value, match.Groups[2].Value);<br />
}<br />
match = regex.Match(firstRes, match.Index + match.Length);<br />
}</p>
<p>postToLogin.Add(&#8220;.save&#8221;, &#8220;Sign In&#8221;);<br />
postToLogin.Add(&#8220;.persistent&#8221;, &#8220;y&#8221;);</p>
<p>//Dim login As String = credential.UserName.Split(&#8220;@&#8221;c)(0)<br />
string login = uname.Split(&#8216;@&#8217;).GetValue(0).ToString();</p>
<p>postToLogin.Add(&#8220;login&#8221;, login);<br />
postToLogin.Add(&#8220;passwd&#8221;, upass);</p>
<p>webClient.Headers[HttpRequestHeader.UserAgent] = _userAgent;<br />
webClient.Headers[HttpRequestHeader.Referer] = _loginPage;<br />
webClient.Encoding = Encoding.UTF8;<br />
webClient.Headers[HttpRequestHeader.Cookie] = webClient.ResponseHeaders[HttpResponseHeader.SetCookie];</p>
<p>webClient.UploadValues(_authUrl, postToLogin);<br />
string cookie = webClient.ResponseHeaders[HttpResponseHeader.SetCookie];</p>
<p>//If String.IsNullOrEmpty(cookie) Then<br />
//Return False<br />
//End If</p>
<p>string newCookie = string.Empty;<br />
string[] tmp1 = cookie.Split(&#8216;,&#8217;);<br />
foreach (string var in tmp1)<br />
{<br />
string[] tmp2 = var.Split(&#8216;;&#8217;);<br />
newCookie = (String.IsNullOrEmpty(newCookie) ? tmp2[0] : newCookie + &#8220;;&#8221; + tmp2[0]);<br />
}</p>
<p>// set login cookie<br />
webClient.Headers[HttpRequestHeader.Cookie] = newCookie;<br />
byte[] thirdResponse = webClient.DownloadData(_addressBookUrl);<br />
string thirdRes = Encoding.UTF8.GetString(thirdResponse);</p>
<p>string crumb = string.Empty;<br />
Regex regexCrumb = new Regex(&#8220;type=\&#8221;hidden\&#8221; name=\&#8221;\\.crumb\&#8221; id=\&#8221;crumb1\&#8221; value=\&#8221;(.*?)\&#8221;", RegexOptions.IgnoreCase);<br />
match = regexCrumb.Match(thirdRes);<br />
if (match.Success &amp;&amp; match.Groups[0].Value.Length &gt; 0)<br />
{<br />
crumb = match.Groups[1].Value;<br />
}</p>
<p>NameValueCollection postDataAB = new NameValueCollection();<br />
postDataAB.Add(&#8220;.crumb&#8221;, crumb);<br />
postDataAB.Add(&#8220;vcp&#8221;, &#8220;import_export&#8221;);<br />
postDataAB.Add(&#8220;submit[action_export_yahoo]&#8220;, &#8220;Export Now&#8221;);</p>
<p>webClient.Headers[HttpRequestHeader.UserAgent] = _userAgent;<br />
webClient.Headers[HttpRequestHeader.Referer] = _addressBookUrl;</p>
<p>byte[] FourResponse = webClient.UploadValues(_addressBookUrl, postDataAB);<br />
string csvData = Encoding.UTF8.GetString(FourResponse);</p>
<p>string[] lines = csvData.Split(&#8216;\n&#8217;);<br />
//Dim list1 As Hashtable()</p>
<p>foreach (string line in lines)<br />
{<br />
string[] items = line.Split(&#8216;,&#8217;);<br />
if (items.Length &lt; 5)<br />
{<br />
continue;<br />
}<br />
string email = items[4];<br />
string name = items[3];<br />
if (!string.IsNullOrEmpty(email) &amp;&amp; !string.IsNullOrEmpty(name))<br />
{<br />
email = email.Trim(&#8216;&#8221;&#8216;);<br />
name = name.Trim(&#8216;&#8221;&#8216;);<br />
if (!email.Equals(&#8220;Email&#8221;) &amp;&amp; !name.Equals(&#8220;Nickname&#8221;))<br />
{<br />
MailContact mailContact = new MailContact();<br />
mailContact.Name = name;<br />
mailContact.Email = email;<br />
myarray.Add(email);<br />
//list.Add(mailContact)</p>
<p>}<br />
}<br />
}</p>
<p>result = true;<br />
}<br />
catch<br />
{<br />
}<br />
return myarray;<br />
}</p>
<p>protected void btnSubmit_Click(object sender, EventArgs e)<br />
{<br />
ArrayList contacts = new ArrayList();<br />
StringBuilder sb = new StringBuilder();<br />
contacts = Extract(txtusername.Text.Trim(), txtpassword.Text.Trim());<br />
int j = 1;<br />
for (int i = 0; i &lt; contacts.Count; i++)<br />
{<br />
if (contacts[i].ToString().Trim() != &#8220;&#8221;)<br />
{<br />
sb.Append(&#8220;(&#8221; + j + &#8220;) &#8221; + contacts[i].ToString() + &#8220;&lt;br&gt;&#8221;);<br />
j++;<br />
}<br />
}<br />
dvcontacts.InnerHtml = sb.ToString();<br />
}<br />
}<br />
public class MailContact<br />
{<br />
private string _email = string.Empty;<br />
private string _name = string.Empty;</p>
<p>public string Name<br />
{<br />
get { return _name; }<br />
set { _name = value; }<br />
}</p>
<p>public string Email<br />
{<br />
get { return _email; }<br />
set { _email = value; }<br />
}</p>
<p>public string FullEmail<br />
{<br />
get { return Email; }<br />
}<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=42&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/07/02/get-contact-list-from-yahoo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
		<item>
		<title>AjaxPro.NET</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/06/24/ajaxpro-net/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/06/24/ajaxpro-net/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:58:22 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/2009/06/24/ajaxpro-net/</guid>
		<description><![CDATA[AjaxPro.NET is a well-known open source framework, which is based on the server-side techniques and provides support for constructing different versions of .NET Web applications. The framework supports the server-side Its main functions are listed as below: Access the Session and Application data from the client-side JavaScript Cache the required results Freely use source code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=40&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>AjaxPro.NET is a well-known open source framework, which is based on the server-side techniques and provides support for constructing different versions of .NET Web applications. The framework supports the server-side Its main functions are listed as below:</p>
<ul>
<li> Access the Session and Application data from the client-side JavaScript</li>
<li> Cache the required results</li>
<li> Freely use source code</li>
<li> Add and modify new methods and properties in the framework without modifying any source code</li>
<li> All the classes support the client-side JavaScript to return data, and DataSet can be used from inside the JavaScript<br />
Use the HTML controls to access and return data</li>
<li> Do not need reload the pages and use the event delegate to access data</li>
<li> Supply only one method for call and dramatically decrease the CPU usage</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=40&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/06/24/ajaxpro-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
		<item>
		<title>Learning about ASP.NET MVC</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/03/25/learning-about-aspnet-mvc/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/03/25/learning-about-aspnet-mvc/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 12:08:35 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[ASP.NET MVC]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/?p=34</guid>
		<description><![CDATA[Today i am sharing something Exciting about ASP.Net MVC ;Here’s a guide for learning about ASP.NET MVC.To Install ASP.NET MVC you need to install ASP.NET 3.5 version on your system. The Model-View-Controller (MVC) is collection of three separates components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative way to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=34&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">Today i am sharing something Exciting about ASP.Net MVC ;Here’s a guide for learning about <strong>ASP.NET MVC</strong>.To Install<strong> ASP.NET MVC</strong> you need to install ASP.NET 3.5 version on your system.</p>
<p style="text-align:left;">The Model-View-Controller (MVC) is collection of three separates components: the model, the view, and the controller. The <strong>ASP.NET MVC framework</strong> provides an alternative way to creating MVC-based application; The MVC-Based applications are different from the ASP.NET Web Forms applications.MVC use all the existing features of ASP.Net Web application. The MVC framework is defined in the System.Web.Mvc namespace.</p>
<p style="text-align:left;"><strong>Understanding Models, Views, and Controllers: </strong></p>
<p style="text-align:left;"><strong>Models</strong> for maintaining data and it help to implements the logic for the application. Retrieve and store state in the database,<strong> views</strong> for displaying all or a portion of the data, helps of applications user interface, and <strong>controllers</strong> for handling events that affect the model or view (s),and user nitration with the model. in short in an MVC application, the view only displays information; the controller handles and responds to user input and interaction.</p>
<p style="text-align:left;"><strong>The URL difference:</strong></p>
<p style="text-align:left;">when we are using the ASP.net Web Forms application, then it should be correspondence between URL links and pages. But using MVC there is no correspondence between the address types in address bar and pages.</p>
<p style="text-align:left;"><strong>Creating sitemap:</strong></p>
<p style="text-align:left;">The easiest way to create a Sitemap by creating an XML file that describes the navigational structure of your website. You can create a new Sitemap in Visual Studio by selecting the menu option Project, Add New Item, and add a Sitemap file.</p>
<p style="text-align:left;">The  &lt;<strong>sitemapnode&gt; </strong>have the following attributes:</p>
<p style="text-align:left;">•	URL</p>
<p style="text-align:left;">•	Title</p>
<p style="text-align:left;">•	Description</p>
<p style="text-align:left;">•	Resourcekey</p>
<p style="text-align:left;">•	Sitemapfile</p>
<p style="text-align:left;">e.g.</p>
<p style="text-align:left;">Web.sitemap</p>
<p style="text-align:left;"><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--><!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} pre 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> <!--[endif]--></p>
<pre><span style="font-size:8pt;font-family:Arial;">&lt;?xml version="1.0" encoding="utf-8" ?&gt;</span>
<span style="font-size:8pt;font-family:Arial;">&lt;siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" &gt;</span>
<span style="font-size:8pt;font-family:Arial;"><span>    </span>&lt;siteMapNode </span></pre>
<p>url=&#8221;~/&#8221; title=&#8221;Home&#8221; description=&#8221;My Home Page&#8221;&gt;<br />
url=&#8221;~/Product/Index&#8221;<br />
title=&#8221;Products&#8221;<br />
description=&#8221;Our Products&#8221; /&gt;</p>
<p style="text-align:left;">url=&#8221;~/Service/Index&#8221;<br />
title=&#8221;Services&#8221;<br />
description=&#8221;Our Services&#8221; /&gt;</p>
<p style="text-align:left;">url=&#8221;~/Home/About&#8221;<br />
title=&#8221;About&#8221;<br />
description=&#8221;About Us&#8221; /&gt;<br />
<!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--><!--  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:12.0pt; 	font-family:"Times New Roman"; 	mso-fareast-font-family:"Times New Roman";} pre 	{margin:0in; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.25in 1.0in 1.25in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]&gt; &lt;!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin:0in; 	mso-para-margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Times New Roman"; 	mso-ansi-language:#0400; 	mso-fareast-language:#0400; 	mso-bidi-language:#0400;} --> <!--[endif]--></p>
<pre><span style="font-size:8pt;font-family:Arial;">&lt;/siteMapNode&gt;</span>
<span style="font-size:8pt;font-family:Arial;">&lt;/siteMap&gt;</span></pre>
<p style="text-align:left;"><strong>Web.sitemap                                          Sitemap API:</strong></p>
<p style="text-align:left;">The Sitemap API is represents the static sitemap class. The access of the static site map class is anywhere within the MVC application. Static sitemap class helps to determine your current presence status. Static class has following properties:</p>
<p style="text-align:left;">•	CurrentNode</p>
<p style="text-align:left;">•	RootNode</p>
<p style="text-align:left;">•	Childnode</p>
<p style="text-align:left;">•	Description</p>
<p style="text-align:left;">•	Nextsibling</p>
<p style="text-align:left;">•	ParentNode etc</p>
<p style="text-align:left;"><strong>Advantages:</strong></p>
<p style="text-align:left;">• MVC provides test-driven development (TDD) by default.</p>
<p style="text-align:left;">• Use all existing features of ASP.NET in ASP.NT MVC.</p>
<p style="text-align:left;">• Support URL naming patters for SEO.</p>
<p style="text-align:left;">
<p style="text-align:left;">Njoy Coding &#8230;&#8230;&#8230;&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=34&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/03/25/learning-about-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
		<item>
		<title>Read Data From .txt File</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/02/17/read-data-from-txt-file/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/02/17/read-data-from-txt-file/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 04:30:50 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[1]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/?p=29</guid>
		<description><![CDATA[con = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]); Boolean flag = false; cmd = new SqlCommand(); cmd.CommandText = &#8220;SELECT ExecuteDate FROM ExecuteTab where ExecuteDate&#60;=getdate() and PageCode=1&#8243;; cmd.CommandType = CommandType.Text; cmd.Connection = con; con.Open(); dr = cmd.ExecuteReader(); dr.Read(); if (dr.HasRows) { flag = true; } con.Close(); if (flag) { string dd = &#8220;&#8221;; string filetoread; filetoread = Server.MapPath(&#8220;../Data/text.txt&#8221;); StreamReader filestream; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=29&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--> <span style="font-size:10pt;font-family:&quot;">con = <span style="color:blue;">new</span> <span style="color:teal;">SqlConnection</span>(<span style="color:teal;">ConfigurationSettings</span>.AppSettings[<span style="color:maroon;">"ConnectionString"</span>]);</span></p>
<p class="MsoNormal" style="margin-left:-1in;"><span style="font-size:10pt;font-family:&quot;color:teal;"><span> </span>Boolean</span><span style="font-size:10pt;font-family:&quot;"> flag = <span style="color:blue;">false</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">cmd = <span style="color:blue;">new</span> <span style="color:teal;">SqlCommand</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">cmd.CommandText = <span style="color:maroon;">&#8220;SELECT ExecuteDate FROM ExecuteTab where<span> </span>ExecuteDate&lt;=getdate() and PageCode=1&#8243;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">cmd.CommandType = <span style="color:teal;">CommandType</span>.Text;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">cmd.Connection = con;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">con.Open();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dr = cmd.ExecuteReader();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dr.Read();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">if</span><span style="font-size:10pt;font-family:&quot;"> (dr.HasRows)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">flag = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">con.Close();</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">if</span><span style="font-size:10pt;font-family:&quot;"> (flag)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">string</span><span style="font-size:10pt;font-family:&quot;"> dd = <span style="color:maroon;">&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">string</span><span style="font-size:10pt;font-family:&quot;"> filetoread;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">filetoread = Server.MapPath(<span style="color:maroon;">&#8220;../Data/text.txt&#8221;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:teal;">StreamReader</span><span style="font-size:10pt;font-family:&quot;"> filestream;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">filestream = <span style="color:teal;">File</span>.OpenText(filetoread);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">string</span><span style="font-size:10pt;font-family:&quot;"> readcontents;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">readcontents = filestream.ReadToEnd();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">readcontents = readcontents.Remove(0, 26);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">char</span><span style="font-size:10pt;font-family:&quot;">[] textdelimiter = { <span style="color:maroon;">&#8216;|&#8217;</span>, <span style="color:maroon;">&#8216;\n&#8217;</span> };</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">string</span><span style="font-size:10pt;font-family:&quot;">[] splitout = readcontents.Split(textdelimiter);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">readcontents.Split(textdelimiter);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:teal;">DataSet</span><span style="font-size:10pt;font-family:&quot;"> ds = <span style="color:blue;">new</span> <span style="color:teal;">DataSet</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dcol = <span style="color:blue;">new</span> <span style="color:teal;">DataColumn</span>(<span style="color:maroon;">&#8220;Col1&#8243;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dt.Columns.Add(dcol);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dcol = <span style="color:blue;">new</span> <span style="color:teal;">DataColumn</span>(<span style="color:maroon;">&#8220;Col2&#8243;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dt.Columns.Add(dcol);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dcol = <span style="color:blue;">new</span> <span style="color:teal;">DataColumn</span>(<span style="color:maroon;">&#8220;Col3&#8243;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dt.Columns.Add(dcol);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dcol = <span style="color:blue;">new</span> <span style="color:teal;">DataColumn</span>(<span style="color:maroon;">&#8220;Col4&#8243;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dt.Columns.Add(dcol);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dcol = <span style="color:blue;">new</span> <span style="color:teal;">DataColumn</span>(<span style="color:maroon;">&#8220;Col5&#8243;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dt.Columns.Add(dcol);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">long</span><span style="font-size:10pt;font-family:&quot;"> i;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">try</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">for</span><span style="font-size:10pt;font-family:&quot;"> (i = 0; i &lt; splitout.Length &#8211; 1; i = i + 6)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow = dt.NewRow();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow[<span style="color:maroon;">"Col1"</span>] = splitout[i];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow[<span style="color:maroon;">"Col2"</span>] = splitout[i + 1];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow[<span style="color:maroon;">"Col3"</span>] = splitout[i + 2];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow[<span style="color:maroon;">"Col4"</span>] = splitout[i + 3];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow[<span style="color:maroon;">"Col5"</span>] = splitout[i + 4];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">drow[<span style="color:maroon;">"Col6"</span>] = splitout[i + 5];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">dt.Rows.Add(drow);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">catch</span><span style="font-size:10pt;font-family:&quot;"> (<span style="color:teal;">Exception</span> exc)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">filestream.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">StartThread();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Response.Redirect(<span style="color:maroon;">&#8220;MyWebPage.aspx&#8221;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">void</span> StartThread()</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>T = <span style="color:blue;">new</span> System.Threading.<span style="color:teal;">Thread</span>(<span style="color:blue;">new</span> System.Threading.<span style="color:teal;">ThreadStart</span>(Run));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>T.Start();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">private</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">void</span> Run()</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">foreach</span> (<span style="color:teal;">DataRow</span> rd <span style="color:blue;">in</span> dt.Rows)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Boolean</span> flage = <span style="color:blue;">false</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">string</span> address = <span style="color:maroon;">&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd = <span style="color:blue;">new</span> <span style="color:teal;">SqlCommand</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.CommandText = <span style="color:maroon;">&#8220;select num,Address+&#8217;,'+City+&#8217;,'+ Zip as Address from mytab where<span> </span>num=&#8217;&#8221;</span> + rd[14].ToString() + <span style="color:maroon;">&#8220;&#8216;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Connection = con;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>con.Open();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>dr = cmd.ExecuteReader();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>dr.Read();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">if</span> (dr.HasRows)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>flage = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>address = dr[<span style="color:maroon;">"Address"</span>].ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>con.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">if</span> (flage)</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd = <span style="color:blue;">new</span> <span style="color:teal;">SqlCommand</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.CommandText = <span style="color:maroon;">&#8220;update mytab </span></span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;color:maroon;">set Col1=@ Col1, Col2=@ Col2, Col3=@ Col3, Col4=@ Col4, Col5=@ Col5 where<span> </span>num=&#8217;&#8221;</span><span style="font-size:10pt;font-family:&quot;"> + rd[14].ToString() + <span style="color:maroon;">&#8220;&#8216;&#8221;</span>;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.CommandType = <span style="color:teal;">CommandType</span>.Text;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col1&#8243;</span>, rd[0].ToString());</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col2&#8243;</span>, rd[1].ToString());</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col3&#8243;</span>, rd[2].ToString());</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col4&#8243;</span>, rd[3].ToString());</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col5&#8243;</span>, rd[4].ToString());</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Connection = con;</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>con.Open();</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>cmd.ExecuteNonQuery();</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"><span> </span>con.Close();</span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">else</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>GoogleGeocoder.<span style="color:teal;">Coordinate</span> coordinate = GoogleGeocoder.<span style="color:teal;">Geocode</span>.GetCoordinates(address);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>lat = coordinate.Latitude;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>lon = coordinate.Longitude;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd = <span style="color:blue;">new</span> <span style="color:teal;">SqlCommand</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.CommandText = <span style="color:maroon;">&#8220;INSERT INTO mytab </span></span></p>
<p class="MsoNormal">
<p class="MsoNormal">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:maroon;">(Col1,Col2, Col3, Col4, Col5)VALUES (@Col1,@Col2, @Col3, @Col4, @Col5)&#8221;</span><span style="font-size:10pt;font-family:&quot;">;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>cmd.CommandType = <span style="color:teal;">CommandType</span>.Text;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col1&#8243;</span>, rd[0].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col12&#8243;</span>, rd[1].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col3&#8243;</span>, rd[2].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col4&#8243;</span>, rd[3].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Parameters.Add(<span style="color:maroon;">&#8220;@Col5&#8243;</span>, rd[4].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.Connection = con;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>con.Open();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cmd.ExecuteNonQuery();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>con.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> tt) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>T.Suspend();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=29&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/02/17/read-data-from-txt-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
		<item>
		<title>Mortgage Calculator</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/02/13/mortgage-calculator/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/02/13/mortgage-calculator/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 07:40:00 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[Asp.Net Tricks]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/?p=21</guid>
		<description><![CDATA[Today i want to share with all of you how to create a Mortgage calculator to calculate Mortgage . protected void Button1_Click(object sender, EventArgs e) { double result; double loanprincipal; double Downpayment; double MortgagePrincipal; int loanYears; double loanInterest; loanprincipal = Convert.ToDouble(txtAmount.Text); Downpayment = Convert.ToDouble(txtDownpayment.Text); loanYears = Convert.ToInt16(txtYears.Text); loanInterest = Convert.ToDouble(txtRate.Text); MortgagePrincipal = loanprincipal &#8211; Downpayment; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=21&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today i want to share with all of you how to create a Mortgage calculator to calculate Mortgage .</p>
<p class="MsoNormal" style="text-align:left;"><span style="font-size:10pt;font-family:&quot;color:blue;">protected</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">void</span> Button1_Click(<span style="color:blue;">object</span> sender, <span style="color:teal;">EventArgs</span> e)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> result;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> loanprincipal;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> Downpayment;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> MortgagePrincipal;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">int</span> loanYears;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> loanInterest;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>loanprincipal = <span style="color:teal;">Convert</span>.ToDouble(txtAmount.Text);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Downpayment = <span style="color:teal;">Convert</span>.ToDouble(txtDownpayment.Text);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>loanYears = <span style="color:teal;">Convert</span>.ToInt16(txtYears.Text);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>loanInterest = <span style="color:teal;">Convert</span>.ToDouble(txtRate.Text);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>MortgagePrincipal = loanprincipal &#8211; Downpayment;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> totalpay = (loanYears * 12);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>result = <span style="color:teal;">Convert</span>.ToDouble(CalcLoan(MortgagePrincipal, loanYears, loanInterest));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>lbPayment.Text = <span style="color:maroon;">&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>lbPrincipal.Text = <span style="color:maroon;">&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>LbResult.Text = <span style="color:maroon;">&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>lbPrincipal.Text = <span style="color:teal;">Convert</span>.ToString(MortgagePrincipal);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>lbPayment.Text = <span style="color:teal;">Convert</span>.ToString(totalpay);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> Tresult= <span style="color:teal;">Convert</span>.ToDouble(result);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>LbResult.Text=<span style="color:teal;">String</span>.Format(<span style="color:maroon;">&#8220;{0:$#,##0.00;($#,##0.00);Zero}&#8221;</span>, Tresult);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><img class="aligncenter size-full wp-image-20" title="Mortgage Calculator" src="http://mysolution4dotnet.files.wordpress.com/2009/02/calculater3.jpg?w=550" alt="Mortgage Calculator" /><!--[if gte mso 9]&gt;  Normal 0   false false false        MicrosoftInternetExplorer4  &lt;![endif]--><!--[if gte mso 9]&gt;   &lt;![endif]--><span style="font-size:10pt;font-family:&quot;color:blue;">public</span><span style="font-size:10pt;font-family:&quot;"> <span style="color:blue;">double</span> CalcLoan(<span style="color:blue;">double</span> MortgagePrincipal, <span style="color:blue;">int</span> loanYears, <span style="color:blue;">double</span> loanInterest)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> loanMi = (loanInterest / 1200);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">int</span> numMonths = loanYears * 12;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> negNumMonths = 0 &#8211; numMonths;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> monthlyPayment = MortgagePrincipal * loanMi / (1 -<span> </span>System.<span style="color:teal;">Math</span>.Pow((1 + loanMi), negNumMonths));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">double</span> totalPayment = monthlyPayment ;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">return</span> (monthlyPayment);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">}</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=21&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/02/13/mortgage-calculator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>

		<media:content url="http://mysolution4dotnet.files.wordpress.com/2009/02/calculater3.jpg" medium="image">
			<media:title type="html">Mortgage Calculator</media:title>
		</media:content>
	</item>
		<item>
		<title>Set the width of File Upload Control</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/02/12/set-the-width-of-file-upload-control/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/02/12/set-the-width-of-file-upload-control/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 08:18:43 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[General Controls]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/2009/02/12/set-the-width-of-file-upload-control/</guid>
		<description><![CDATA[To set the width of File Upload Control on firefox need to set “Size” property. &#60;asp:FileUpload ID=&#8221;FileUpload1&#8243; size=&#8221;1%&#8221; runat=&#8221;server&#8221;   Font-Size=&#8221;Small&#8221;/&#62;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=14&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">To set the width of File Upload Control on firefox need to set “Size” property.</p>
<p style="text-align:left;">&lt;asp:FileUpload ID=&#8221;FileUpload1&#8243; size=&#8221;1%&#8221; runat=&#8221;server&#8221;   Font-Size=&#8221;Small&#8221;/&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=14&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/02/12/set-the-width-of-file-upload-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
		<item>
		<title>Show Image on Crystal Report from Database</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/02/11/show-image-on-crystal-report-from-database/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/02/11/show-image-on-crystal-report-from-database/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 10:12:31 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[Crystal Report image]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/?p=11</guid>
		<description><![CDATA[To show image on Crystal Report from database you need to take a image field , save image in it by using the following code Step 1) string name = filename.PostedFile.FileName.ToString();//get file name as per your requirment string strFn = path ;//your image path FileInfo fiImage = new FileInfo(strFn); Int32 len =Convert.ToInt32(fiImage.Length); byte[] m_barrImg = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=11&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">To show image on Crystal Report from database you need to take a image field , save image in it by using the following code</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Step 1)<span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">string</span><span style="font-size:10pt;font-family:&quot;"> name = filename.PostedFile.FileName.ToString();//get file name as per your requirment</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">string</span> strFn = path <span style="color:green;">;//your image path</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">FileInfo</span> fiImage = <span style="color:blue;">new</span> <span style="color:teal;">FileInfo</span>(strFn);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Int32</span> len =<span style="color:teal;">Convert</span>.ToInt32(fiImage.Length);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">byte</span>[]<span> </span>m_barrImg = <span style="color:blue;">new</span> <span style="color:blue;">byte</span>[<span style="color:teal;">Convert</span>.ToInt32(len )];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">FileStream</span> fs = <span style="color:blue;">new</span> <span style="color:teal;">FileStream</span>(strFn, <span style="color:teal;">FileMode</span>.Open,</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">FileAccess</span>.Read, <span style="color:teal;">FileShare</span>.Read);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">int</span> iBytesRead = fs.Read(m_barrImg, 0, <span style="color:teal;">Convert</span>.ToInt32(len));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>fs.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">byte</span>[] imageData = ReadFile(path); <span style="color:green;"><span> </span></span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>objpro.Logo1=(<span style="color:blue;">object</span>)m_barrImg;///your image here save it in database(I m assinging it to property)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>objpro.LogoName=Imagename;//image name </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Step 2)<span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">///now to show image on crystal report</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Place this image field on your report by drag &amp; drop.</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Step 3) //where report will show e.g. it may be default.aspx<span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">// I assume you have values in dataset ds;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Int32 Total=0;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">Total = <span style="color:teal;">Convert</span>.ToInt32(ds.Tables[0].Rows.Count.ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">DataTable</span> dt = <span style="color:blue;">new</span> <span style="color:teal;">DataTable</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>dt = ds.Tables[0];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">DataRow</span> drow;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>dt.Columns.Add(<span style="color:maroon;">&#8220;Image&#8221;</span>, System.<span style="color:teal;">Type</span>.GetType(<span style="color:maroon;">&#8220;System.Byte[]&#8220;</span>));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>drow = dt.NewRow();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span><span style="color:teal;">FileStream</span> fs;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">BinaryReader</span> br;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">if</span> (System.IO.<span style="color:teal;">File</span>.Exists(<span style="color:teal;">AppDomain</span>.CurrentDomain.BaseDirectory + <span style="color:maroon;">&#8220;/CompanyLogo/&#8221;</span> + TicketName))</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>fs = <span style="color:blue;">new</span> <span style="color:teal;">FileStream</span>(<span style="color:teal;">AppDomain</span>.CurrentDomain.BaseDirectory + <span style="color:maroon;">&#8220;/CompanyLogo/&#8221;</span> + TicketName, <span style="color:teal;">FileMode</span>.Open);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">else</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>fs = <span style="color:blue;">new</span> <span style="color:teal;">FileStream</span>(<span style="color:teal;">AppDomain</span>.CurrentDomain.BaseDirectory + <span style="color:maroon;">&#8220;/CompanyLogo/logo.png&#8221;</span>, <span style="color:teal;">FileMode</span>.Open);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>br = <span style="color:blue;">new</span> <span style="color:teal;">BinaryReader</span>(fs);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">byte</span>[] imgbyte = <span style="color:blue;">new</span> <span style="color:blue;">byte</span>[fs.Length + 1];</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>imgbyte = br.ReadBytes(<span style="color:teal;">Convert</span>.ToInt32((fs.Length)));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>drow[0] = imgbyte;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>dt.Rows.Add(drow[0]);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>br.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>fs.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">ReportDocument</span> report = <span style="color:blue;">new</span> <span style="color:teal;">ReportDocument</span>();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">string</span> reportPath2 = Server.MapPath(<span style="color:maroon;">&#8220;myRpt.rpt&#8221;</span>);//your Report Name here </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>report.Load(reportPath2);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">if</span> (Total != 0)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>report.SetDataSource(dt);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>CrystalReportViewer1.ReportSource = report;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=11&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/02/11/show-image-on-crystal-report-from-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating .PDF File using Database Fields</title>
		<link>http://mysolution4dotnet.wordpress.com/2009/02/10/creating-pdf-file-using-database-fields/</link>
		<comments>http://mysolution4dotnet.wordpress.com/2009/02/10/creating-pdf-file-using-database-fields/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 09:09:00 +0000</pubDate>
		<dc:creator>Kamal Sran</dc:creator>
				<category><![CDATA[File Creation]]></category>

		<guid isPermaLink="false">http://mysolution4dotnet.wordpress.com/?p=4</guid>
		<description><![CDATA[try { Rectangle pageSize = new Rectangle(900, 900); Document doc = new Document(pageSize); PdfWriter.GetInstance(doc, new FileStream(Request.PhysicalApplicationPath + &#8220;\\Reports\\CustomReports\\AllReports\\&#8221; + ReportTitile + &#8220;.pdf&#8221;, FileMode.Create)); HeaderFooter footer = new HeaderFooter(new Phrase(&#8220;Page &#8220;), new Phrase(&#8220;.&#8221;)); footer.Border = Rectangle.NO_BORDER; footer.Alignment = HeaderFooter.ALIGN_RIGHT; doc.Footer = footer; doc.Open(); iTextSharp.text.Table table = new iTextSharp.text.Table(7); table.BorderWidth = 1; // table.BorderColor = new Color(0, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=4&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:blue;">try</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Rectangle</span> pageSize = <span style="color:blue;">new</span> <span style="color:teal;">Rectangle</span>(900, 900);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Document</span> doc = <span style="color:blue;">new</span> <span style="color:teal;">Document</span>(pageSize);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">PdfWriter</span>.GetInstance(doc, <span style="color:blue;">new</span> <span style="color:teal;">FileStream</span>(Request.PhysicalApplicationPath + <span style="color:maroon;">&#8220;\\Reports\\CustomReports\\AllReports\\&#8221;</span> + ReportTitile + <span style="color:maroon;">&#8220;.pdf&#8221;</span>, <span style="color:teal;">FileMode</span>.Create));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:teal;">HeaderFooter</span><span style="font-size:10pt;font-family:&quot;"> footer = <span style="color:blue;">new</span> <span style="color:teal;">HeaderFooter</span>(<span style="color:blue;">new</span> <span style="color:teal;">Phrase</span>(<span style="color:maroon;">&#8220;Page &#8220;</span>), <span style="color:blue;">new</span> <span style="color:teal;">Phrase</span>(<span style="color:maroon;">&#8220;.&#8221;</span>));</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>footer.Border = <span style="color:teal;">Rectangle</span>.NO_BORDER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>footer.Alignment = <span style="color:teal;">HeaderFooter</span>.ALIGN_RIGHT;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>doc.Footer = footer;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>doc.Open();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;">iTextSharp.text.<span style="color:teal;">Table</span> table = <span style="color:blue;">new</span> iTextSharp.text.<span style="color:teal;">Table</span>(7);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.BorderWidth = 1;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:green;">// table.BorderColor = new Color(0, 0, 255);</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.Padding = 3;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.Spacing = 1;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(<span style="color:maroon;">&#8221; Report Title &#8211; &#8220;</span> + ReportTitile);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.Colspan = 7;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>cell.HorizontalAlignment = <span style="color:teal;">Element</span>.ALIGN_CENTER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.VerticalAlignment = <span style="color:teal;">Element</span>.ALIGN_MIDDLE;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.Colspan = 7;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.BackgroundColor = <span style="color:blue;">new</span> <span style="color:teal;">Color</span>(200, 200, 200);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">string</span> Col1 = <span style="color:maroon;">&#8220;&#8221;</span>, Col2 = <span style="color:maroon;">&#8220;&#8221;</span>, Col3 = <span style="color:maroon;">&#8220;&#8221;</span>, Col4 = <span style="color:maroon;">&#8220;&#8221;</span>, Col5 = <span style="color:maroon;">&#8220;&#8221;</span>, Col6 = <span style="color:maroon;">&#8220;&#8221;</span>, Col7 = <span style="color:maroon;">&#8220;&#8221;</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>Col1 = ddlCol1.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Col2 = ddlCol2.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Col3 = ddlCol3.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Col4 = ddlCol4.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Col5 = ddlCol5.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Col6 = ddlCol6.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>Col7 = ddlCol7.SelectedItem.Text.ToString();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell2 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col1);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell2);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell3 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col2);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell3);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell4 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col3);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell4);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell5 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col4);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell5);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell6 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col5);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell6);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell7 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col6);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell7);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:teal;">Cell</span> cell8 = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(Col7);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell8);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell2.BackgroundColor = <span style="color:blue;">new</span> iTextSharp.text.<span style="color:teal;">Color</span>(System.Drawing.<span style="color:teal;">Color</span>.Linen);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell3.BackgroundColor = <span style="color:blue;">new</span> iTextSharp.text.<span style="color:teal;">Color</span>(System.Drawing.<span style="color:teal;">Color</span>.Linen);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell4.BackgroundColor = <span style="color:blue;">new</span> iTextSharp.text.<span style="color:teal;">Color</span>(System.Drawing.<span style="color:teal;">Color</span>.Linen);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell5.BackgroundColor = <span style="color:blue;">new</span> iTextSharp.text.<span style="color:teal;">Color</span>(System.Drawing.<span style="color:teal;">Color</span>.Linen);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell2.HorizontalAlignment = <span style="color:teal;">Element</span>.ALIGN_CENTER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell2.VerticalAlignment = <span style="color:teal;">Element</span>.ALIGN_MIDDLE;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell3.HorizontalAlignment = <span style="color:teal;">Element</span>.ALIGN_CENTER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell3.VerticalAlignment = <span style="color:teal;">Element</span>.ALIGN_MIDDLE;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell4.HorizontalAlignment = <span style="color:teal;">Element</span>.ALIGN_CENTER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell4.VerticalAlignment = <span style="color:teal;">Element</span>.ALIGN_MIDDLE;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell5.HorizontalAlignment = <span style="color:teal;">Element</span>.ALIGN_CENTER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell5.VerticalAlignment = <span style="color:teal;">Element</span>.ALIGN_MIDDLE;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.Header = <span style="color:blue;">true</span>;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">for</span> (<span style="color:blue;">int</span> ii = 0; ii &lt; total; ii++)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell = <span style="color:blue;">new</span> <span style="color:teal;">Cell</span>(ds.Tables[0].Rows[ii][objpro.column1].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.BorderColor = <span style="color:blue;">new</span> <span style="color:teal;">Color</span>(255, 0, 0);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(cell);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(ds.Tables[0].Rows[ii][objpro.column2].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(<span style="color:maroon;">&#8221; &#8220;</span>);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(ds.Tables[0].Rows[ii][objpro.column3].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww) { table.AddCell(<span style="color:maroon;">&#8221; &#8220;</span>); }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(ds.Tables[0].Rows[ii][objpro.column4].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww) { table.AddCell(<span style="color:maroon;">&#8221; &#8220;</span>); }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(ds.Tables[0].Rows[ii][objpro.column5].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww) { table.AddCell(<span style="color:maroon;">&#8221; &#8220;</span>); }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(ds.Tables[0].Rows[ii][objpro.column6].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww) { table.AddCell(<span style="color:maroon;">&#8221; &#8220;</span>); }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">try</span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>table.AddCell(ds.Tables[0].Rows[ii][objpro.column7].ToString());</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qww) { table.AddCell(<span style="color:maroon;">&#8221; &#8220;</span>); }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.HorizontalAlignment = <span style="color:teal;">Element</span>.ALIGN_CENTER;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>cell.VerticalAlignment = <span style="color:teal;">Element</span>.ALIGN_MIDDLE;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (<span style="color:teal;">Exception</span> qqq)</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>{</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>doc.Add(table);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>doc.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;color:green;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span>}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><span> </span><span style="color:blue;">catch</span> (System.<span style="color:teal;">Exception</span> qqq) { }</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:&quot;"><a class="alignleft" title="DLL" href="http://www.nodevice.com/dll/itextsharp_dll/item21198.html" target="_blank">iTextSharp </a><br />
</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mysolution4dotnet.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mysolution4dotnet.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mysolution4dotnet.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mysolution4dotnet.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mysolution4dotnet.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mysolution4dotnet.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mysolution4dotnet.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mysolution4dotnet.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mysolution4dotnet.wordpress.com&amp;blog=6525679&amp;post=4&amp;subd=mysolution4dotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mysolution4dotnet.wordpress.com/2009/02/10/creating-pdf-file-using-database-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6190a17b3b6ee6946ec92141de5cab7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Preet</media:title>
		</media:content>
	</item>
	</channel>
</rss>
