<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0AGRnw6cSp7ImA9WhRRFEk.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135</id><updated>2011-11-27T16:55:27.219-08:00</updated><category term="C#" /><category term="MVC3" /><category term="SQL" /><category term="Java" /><category term=".NET" /><category term="ASP.NET" /><title>IT Zone</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://dineshkumara.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/nUrJ" /><feedburner:info uri="blogspot/nurj" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;AkQAR3o_eSp7ImA9WhdTFE0.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-3144436693783168293</id><published>2011-07-11T11:19:00.000-07:00</published><updated>2011-07-11T11:19:06.441-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-11T11:19:06.441-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC3" /><title>MVC3 TryUpdateModel() -Update Model for Edit</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3x2tNffz9OuIgsGHPjbn3Tlh8lg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3x2tNffz9OuIgsGHPjbn3Tlh8lg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3x2tNffz9OuIgsGHPjbn3Tlh8lg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3x2tNffz9OuIgsGHPjbn3Tlh8lg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;When we want to update model with edited values we can use &lt;i&gt;TryUpdateModel(&lt;/i&gt;)  method.&lt;br /&gt;
&lt;br /&gt;
example&lt;br /&gt;
&lt;pre&gt;[Httppost]
public ActionResult edit(int id)
{
    var user= UserRepository.GetUser(id);

    if (TryUpdateModel(user))
    {
        UserRepository.save();
    }

    return view()
}

&lt;/pre&gt;&lt;br /&gt;
But some times when we use &lt;i&gt;TryUpdateModel() &lt;/i&gt; the model does not update that mean the method return false.So in that case we need to find out the error so we can do that as flowing it will return the list of errors and their corresponding properties.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;[Httppost]
public ActionResult edit(int id)
{
    var user= UserRepository.GetUser(id);

    if (TryUpdateModel(user))
    {
        UserRepository.save();
    }
else{
//the tru update method return false
    
    var errors = ModelState
    .Where(m =&amp;gt; m.Value.Errors.Count &amp;gt; 0)
    .Select(m =&amp;gt; new { m.Key, m.Value.Errors })
    .ToArray();

}

    return view()
}
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;Why TryUpdateModel() return false ?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Most of the time the &lt;i&gt;TryUpdateModel()&lt;/i&gt; method return false when we have not add editable field or hidden filed for all the required fields to view  page.&lt;br /&gt;
so we can simply add hidden filed to the view which we don't need to  change  during the update method.&lt;br /&gt;
&lt;br /&gt;
so My user Model&lt;br /&gt;
&lt;pre&gt;Public Class User{
[Requried]
public int UserId{get;set}
[Requried]
public string UserName {get;set}
[Requried]
pubic string UserCode{get;set}

pubic string Description{get;set}

public string Address{get;set}

}
&lt;/pre&gt;&lt;br /&gt;
So if&amp;nbsp; I want to update UserDescription in my edit page&lt;br /&gt;
I have to put UserId,UserName and UserCode as  Hidden filed&lt;br /&gt;
&lt;br /&gt;
But if our model content large number of fields and we only need to update few of fields in that case we can do it by specify the fields which we need to update as following&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;TryUpdateModel(model, new [] {"Description", "Address"}); // In this case the TryUpdate() only  check vaidation "Description","Address"


&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
And&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=1430234016&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt; also we can do it as fallowing by mentioning the field which should not update&lt;br /&gt;
&lt;pre&gt;TryUpdateModel(model, null, null, new [] {"UserId","UserName ","UserCode"});//In this case the TryUpdate() ignore "UserId","UserName" and "Usercode" vaidation

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-3144436693783168293?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/Wnqy8oA1AG4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/3144436693783168293/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2011/07/mvc3-tryupdatemodel-update-model-for.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/3144436693783168293?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/3144436693783168293?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/Wnqy8oA1AG4/mvc3-tryupdatemodel-update-model-for.html" title="MVC3 TryUpdateModel() -Update Model for Edit" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2011/07/mvc3-tryupdatemodel-update-model-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUBQn87cSp7ImA9WhdTEUQ.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-2466204438760207568</id><published>2011-07-04T00:07:00.000-07:00</published><updated>2011-07-08T22:44:13.109-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-08T22:44:13.109-07:00</app:edited><title>Remove Validation Error messege  when click Reset Button in MVC3 Razor</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DhFOpGqTHXfZc0l92Y_YqwI1vVQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DhFOpGqTHXfZc0l92Y_YqwI1vVQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DhFOpGqTHXfZc0l92Y_YqwI1vVQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DhFOpGqTHXfZc0l92Y_YqwI1vVQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;The reset button d&lt;i&gt;oes not clear validation message in mvc3 &lt;/i&gt;by default so&amp;nbsp; we need to do this with jQuery.The fallowing function clear validation messages in MVC3 pages.&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;jQuery(document).ready(function () {

            $("input:reset").click(function () {
                $('.field-validation-error')
               .removeClass('field-validation-error')
                .addClass('field-validation-valid');

                $('.input-validation-error')
                .removeClass('input-validation-error')
                 .addClass('valid');
            });

  });
&lt;/pre&gt;&lt;div&gt;&lt;a imageanchor="1" target="_blank"  href="http://www.amazon.com/Professional-ASP-NET-MVC-Jon-Galloway/dp/1118076583?ie=UTF8&amp;tag=it0d7-20&amp;link_code=bil&amp;camp=213689&amp;creative=392969"&gt;&lt;img alt="Professional ASP.NET MVC 3" src="http://ws.amazon.com/widgets/q?MarketPlace=US&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL160_&amp;ASIN=1118076583&amp;tag=it0d7-20" /&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=it0d7-20&amp;l=bil&amp;camp=213689&amp;creative=392969&amp;o=1&amp;a=1118076583" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important; padding: 0px !important" /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-2466204438760207568?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/Evs0V45XwFw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/2466204438760207568/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2011/07/remove-validation-error-messege-when.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/2466204438760207568?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/2466204438760207568?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/Evs0V45XwFw/remove-validation-error-messege-when.html" title="Remove Validation Error messege  when click Reset Button in MVC3 Razor" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2011/07/remove-validation-error-messege-when.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcFQ3w_cSp7ImA9WhdTEUQ.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-4616125662014116453</id><published>2011-06-27T01:46:00.000-07:00</published><updated>2011-07-08T22:40:12.249-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-08T22:40:12.249-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC3" /><title>MVC 3 Razor TextBox max length</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eGzGnyFZxm1ZDtaXxHlO8Mrk8ZA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eGzGnyFZxm1ZDtaXxHlO8Mrk8ZA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eGzGnyFZxm1ZDtaXxHlO8Mrk8ZA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eGzGnyFZxm1ZDtaXxHlO8Mrk8ZA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;@Html.TextBoxFor(model =&amp;gt; model.Organization.OrganizationName, new { maxlength = 50 }) 

&lt;/pre&gt;&lt;a imageanchor="1" target="_blank"  href="http://www.amazon.com/Applied-ASP-NET-MVC-Context-Pro/dp/1430234016?ie=UTF8&amp;tag=it0d7-20&amp;link_code=bil&amp;camp=213689&amp;creative=392969"&gt;&lt;img alt="Applied ASP.NET MVC 3 in Context (Pro)" src="http://ws.amazon.com/widgets/q?MarketPlace=US&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL160_&amp;ASIN=1430234016&amp;tag=it0d7-20" /&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=it0d7-20&amp;l=bil&amp;camp=213689&amp;creative=392969&amp;o=1&amp;a=1430234016" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important; padding: 0px !important" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-4616125662014116453?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/XAzJe7uFeVA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/4616125662014116453/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2011/06/mvc-3-razor-textbox-max-length.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4616125662014116453?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4616125662014116453?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/XAzJe7uFeVA/mvc-3-razor-textbox-max-length.html" title="MVC 3 Razor TextBox max length" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2011/06/mvc-3-razor-textbox-max-length.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0ACQ3w9eyp7ImA9WhZbEU8.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-6488810730812510850</id><published>2011-06-12T21:32:00.001-07:00</published><updated>2011-06-15T00:09:22.263-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-15T00:09:22.263-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MVC3" /><title>MVC 3 Razor Editor Template</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/IwMf9PHnJtyWXaAKhKQWIAJgPmk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IwMf9PHnJtyWXaAKhKQWIAJgPmk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/IwMf9PHnJtyWXaAKhKQWIAJgPmk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/IwMf9PHnJtyWXaAKhKQWIAJgPmk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;b&gt;Editor Template&lt;/b&gt; is very useful future in Asp.net &lt;i&gt;MVC3 Framework&lt;/i&gt;.With Editor Template we can create template for model and&amp;nbsp; It&amp;nbsp; can be access easily in the application (like user controller in asp.net).&lt;br /&gt;
So I'm going to create Editor Template for Book Model in my application.&lt;br /&gt;
&lt;u&gt;Book.cs&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;public class Book
{
public int BookId { get; set; }
public string BookName { get; set; }
public string Description { get; set; }
}
&lt;/pre&gt;Then I'm going to create folder&amp;nbsp; as&lt;b&gt; EditorTemplates &lt;/b&gt;in &lt;b&gt;Shared&lt;/b&gt; folder&amp;nbsp; and add new view &lt;b&gt;Book.cshtml&lt;/b&gt; as following.&lt;b&gt;(The Name of the Template should be same as Class Name)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&amp;nbsp;&lt;/b&gt;.&lt;br /&gt;
&lt;pre&gt;@model MySimpleEditorTemplate.Models.Book

&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;@Html.DisplayFor(p =&amp;gt; p.BookId)  &lt;/td&gt;&lt;td&gt;@Html.EditorFor(p =&amp;gt; p.BookId)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;@Html.DisplayFor(p =&amp;gt; p.BookName)&lt;/td&gt;&lt;td&gt;@Html.EditorFor(p =&amp;gt; p.BookName)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;@Html.DisplayFor(p =&amp;gt; p.Description)&lt;/td&gt;&lt;td&gt;@Html.EditorFor(p =&amp;gt; p.Description)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;/pre&gt;&lt;br /&gt;
Then in view page simply we can add editor for book as &lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;@Html.EditorFor(model =&amp;gt; model.Book)&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;then it will display above block&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-6488810730812510850?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/k0kp1OTLMn4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/6488810730812510850/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2011/06/mvc-3-razor-editor-template.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6488810730812510850?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6488810730812510850?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/k0kp1OTLMn4/mvc-3-razor-editor-template.html" title="MVC 3 Razor Editor Template" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2011/06/mvc-3-razor-editor-template.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4MQ3c4fSp7ImA9Wx5VF00.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-3321231192357891930</id><published>2010-10-06T10:02:00.000-07:00</published><updated>2010-10-10T02:29:42.935-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-10T02:29:42.935-07:00</app:edited><title>Accsess The Magento Core API With Dot net technologies</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CO-AeF0yZqlbrqYE1fCP0I9_Lfo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CO-AeF0yZqlbrqYE1fCP0I9_Lfo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CO-AeF0yZqlbrqYE1fCP0I9_Lfo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CO-AeF0yZqlbrqYE1fCP0I9_Lfo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;a href="http://www.magentocommerce.com/" target="_blank"&gt;Magento&lt;/a&gt; is one of the most popular e-commerce platforms.which based&amp;nbsp; on PHP and Mysql.Magento Core API supports both SOAP and XML RPC protocols. The API is permission based and allows access to the Customer, Catalog and Order modules of Magento. Please reference the &lt;a href="http://www.magentocommerce.com/support/magento_core_api"&gt;documentation &lt;/a&gt;for more information.&lt;br /&gt;
This article I am going to explaining &lt;b&gt;How to access magento web service from Dot net Technologies .&lt;/b&gt;&lt;br /&gt;
we can access magento soap api with following url.&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
http://mymagento.com/api/v2_soap?wsdl (You can see wsdl definition by typing this url in web browser)&lt;b&gt;.&lt;/b&gt;&lt;br /&gt;
So let see how to display Magento customer list in my WindowsFormsApplication project.&lt;br /&gt;
To consume to the magento web service in our application we should add web Reference by rigth click on solution .&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://2.bp.blogspot.com/_bUOGJj1h8PI/TLFo5b2vnOI/AAAAAAAAA2c/vmSbdk1vkAE/s1600/magento1.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_bUOGJj1h8PI/TLFo5b2vnOI/AAAAAAAAA2c/vmSbdk1vkAE/s1600/magento1.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the web reference dialog box type the magento web service URL (http://mymagento.com/api/v2_soap?wsdl) and click Go button then available service method display as following screen.&lt;br /&gt;
Then we can change the web service name and click Add Refference button.&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_bUOGJj1h8PI/TLFqPZCTfiI/AAAAAAAAA2g/SKqGu2N7HtI/s1600/magento2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="283" src="http://1.bp.blogspot.com/_bUOGJj1h8PI/TLFqPZCTfiI/AAAAAAAAA2g/SKqGu2N7HtI/s400/magento2.bmp" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;By doing above steps,we can generate&amp;nbsp; the web service proxy &lt;b&gt;.&lt;/b&gt;&lt;br /&gt;
C# code to retrieve&amp;nbsp; customer list.&lt;br /&gt;
&lt;pre&gt;&amp;nbsp;using Magento.com.mymagento

public void&amp;nbsp; showCustomrs(){
&amp;nbsp;&amp;nbsp; MagentoService ms = new MagentoService();
&amp;nbsp;&amp;nbsp; string sesion= ms.login("Dinesh", "123456");
&amp;nbsp;&amp;nbsp; filters myfilter=new filters();//filter criteriya
&amp;nbsp;&amp;nbsp; customerCustomerEntity[] cusls= ms.customerCustomerList(sesion,myfilter);//get customers
&amp;nbsp;&amp;nbsp; dgCutomer.ItemsSource = cusls;&lt;b&gt; //&lt;/b&gt;display in grid&lt;b&gt;&lt;/b&gt;
&lt;b&gt;}
&lt;/b&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-3321231192357891930?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/uEUpcIKc7-Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/3321231192357891930/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2010/10/accsess-magento-core-api-with-dot-net.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/3321231192357891930?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/3321231192357891930?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/uEUpcIKc7-Y/accsess-magento-core-api-with-dot-net.html" title="Accsess The Magento Core API With Dot net technologies" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_bUOGJj1h8PI/TLFo5b2vnOI/AAAAAAAAA2c/vmSbdk1vkAE/s72-c/magento1.bmp" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2010/10/accsess-magento-core-api-with-dot-net.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcAR3o_eCp7ImA9Wx5SEUU.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-6021732397551526287</id><published>2010-08-07T06:12:00.000-07:00</published><updated>2010-08-07T06:34:06.440-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-07T06:34:06.440-07:00</app:edited><title>How to Create WCF Application</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1X6ihlBJlXaGs4IOcJWMKOD_pkM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1X6ihlBJlXaGs4IOcJWMKOD_pkM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1X6ihlBJlXaGs4IOcJWMKOD_pkM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1X6ihlBJlXaGs4IOcJWMKOD_pkM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Select WCF Service Application from New Project window in Visual Studio and name the project as MyWCFService&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_bUOGJj1h8PI/TF1YSdr4r5I/AAAAAAAAA2A/kwrdhbpb0Lo/s1600/WCF1.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="290" src="http://1.bp.blogspot.com/_bUOGJj1h8PI/TF1YSdr4r5I/AAAAAAAAA2A/kwrdhbpb0Lo/s400/WCF1.bmp" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Add WCF Service to the “MyWCFService” project and named as Myservice.svc&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_bUOGJj1h8PI/TF1Y44aChRI/AAAAAAAAA2I/u19nqNtZoTI/s1600/wcf2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="247" src="http://1.bp.blogspot.com/_bUOGJj1h8PI/TF1Y44aChRI/AAAAAAAAA2I/u19nqNtZoTI/s400/wcf2.bmp" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;What is Service Contracts ?&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;Describe which operations the client can perform on the service. There are two types of Service Contracts. &lt;br /&gt;
&lt;b&gt;ServiceContract&lt;/b&gt; - This attribute is used to define the Interface. &lt;br /&gt;
&lt;b&gt;OperationContract&lt;/b&gt; - This attribute is used to define the method inside Interface.&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;IMyService.cs&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;


[ServiceContract]

public interface IService

{

&amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Employeee GetEmployee(int id);// service method

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

}
&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;br /&gt;
Then we can implement above interface&lt;br /&gt;
&lt;br /&gt;
MyService.cs&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.Text;

using Common;

&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MyService: IMyService

&amp;nbsp;&amp;nbsp;&amp;nbsp; {


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #region MyService Members


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Employeee GetEmployee(int id)//service method implimentation

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;Employeee emp = new Employeee { EmpId = Guid.NewGuid(),Name="Dinesh",Type=EmployeeTypesEnum.Accounter };

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return emp;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion

&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;What is Data contracts?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Define which data types are passed to and from the service. WCF defines implicit contracts for built-in types such as int and string, but we can easily define explicit opt-in data contracts for custom types.&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ms731923.aspx"&gt;Types Supported by the Data Contract Serializer&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There are two types of Data Contracts.&lt;br /&gt;
DataContract - attribute used to define the class&lt;br /&gt;
DataMember - attribute used to define the properties&lt;br /&gt;
&lt;br /&gt;
Add Class Employee to the solution&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Runtime.Serialization;

using System.ServiceModel;


&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataContract]

&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Employeee

&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Guid EmpId { get; set; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Name { get; set; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public EmployeeTypesEnum Type { set; get; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;&lt;br /&gt;
&lt;span style="font-size: large;"&gt;How To Pass Enum with WCF services?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To pass Enum the Data contracts should be define with EnumMember() attributes.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt;using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Runtime.Serialization;


&amp;nbsp;[DataContract]

&amp;nbsp;&amp;nbsp; public enum EmployeeTypesEnum

&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp; [EnumMember()]


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Administrator = 0,


&amp;nbsp;&amp;nbsp;&amp;nbsp; [EnumMember()]


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Manager = 1,


&amp;nbsp;&amp;nbsp;&amp;nbsp; [EnumMember()]


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Accounter = 2


}
&lt;/span&gt;&lt;/pre&gt;&lt;span style="font-family: &amp;quot;Verdana&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10pt;"&gt; &lt;br /&gt;
&lt;span style="font-size: large;"&gt;How to Test WCF application ?&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
WCF service can test with WCF Test Client (WcfTestClient.exe) by&amp;nbsp; execute WcfTestClient.exe commond in Visual Studio Command prompt .&lt;br /&gt;
&amp;nbsp;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-6021732397551526287?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/DgIK-YgKfI0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/6021732397551526287/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2010/08/how-to-create-wcf-application.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6021732397551526287?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6021732397551526287?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/DgIK-YgKfI0/how-to-create-wcf-application.html" title="How to Create WCF Application" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_bUOGJj1h8PI/TF1YSdr4r5I/AAAAAAAAA2A/kwrdhbpb0Lo/s72-c/WCF1.bmp" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2010/08/how-to-create-wcf-application.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkQEQn05cSp7ImA9WxFXEE0.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-2131977638981553173</id><published>2010-05-16T04:11:00.000-07:00</published><updated>2010-05-16T04:11:43.329-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-16T04:11:43.329-07:00</app:edited><title>DATA ACCESS LAYER</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P_v-QOQM8we-DBVp1H4y2cpGlAA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P_v-QOQM8we-DBVp1H4y2cpGlAA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P_v-QOQM8we-DBVp1H4y2cpGlAA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P_v-QOQM8we-DBVp1H4y2cpGlAA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;This is base class witch handle common function in Data Access  Layer.&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Linq;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using System.Configuration;&lt;br /&gt;
using System.Web;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Data;&lt;br /&gt;
&lt;br /&gt;
namespace DAL&lt;br /&gt;
{&lt;br /&gt;
    public class DataHelper&lt;br /&gt;
    {&lt;br /&gt;
        private string Conncton_string = ConfigurationManager.ConnectionStrings["MyDB"].ConnectionString;&lt;br /&gt;
        private SqlConnection sqlConn = new SqlConnection();&lt;br /&gt;
        public static SqlParameter[] _dataParameters = null;&lt;br /&gt;
        public DataHelper()&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        private SqlConnection openConnection()&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
            sqlConn.ConnectionString = Conncton_string;&lt;br /&gt;
            sqlConn.Open();&lt;br /&gt;
            return sqlConn;&lt;br /&gt;
&lt;br /&gt;
        }&lt;br /&gt;
        private void CloseConnection()&lt;br /&gt;
        {&lt;br /&gt;
            sqlConn.Close();&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
//For a execute non query&lt;br /&gt;
        public void ExecuteNonQuery(CommandType commandType, string commandText, SqlParameter[] parameterCollection)&lt;br /&gt;
        {&lt;br /&gt;
            SqlCommand sqlCmd = new SqlCommand();&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                sqlCmd.Connection = openConnection();&lt;br /&gt;
                sqlCmd.CommandType = commandType;&lt;br /&gt;
                sqlCmd.CommandText = commandText;&lt;br /&gt;
                sqlCmd.Parameters.AddRange(parameterCollection);&lt;br /&gt;
                sqlCmd.ExecuteNonQuery();&lt;br /&gt;
                sqlCmd.Parameters.Clear();&lt;br /&gt;
            }&lt;br /&gt;
            catch (SqlException sqlEx)&lt;br /&gt;
            {&lt;br /&gt;
                throw sqlEx;&lt;br /&gt;
            }&lt;br /&gt;
            catch (Exception ex)&lt;br /&gt;
            {&lt;br /&gt;
                throw ex;&lt;br /&gt;
            }&lt;br /&gt;
            finally&lt;br /&gt;
            {&lt;br /&gt;
                CloseConnection();&lt;br /&gt;
                sqlCmd.Dispose();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
//to get DataSet&lt;br /&gt;
        public DataSet GetData(CommandType commandType, string commandText, SqlParameter[] parameterCollection)&lt;br /&gt;
        {&lt;br /&gt;
&lt;br /&gt;
            SqlDataAdapter sqlAdp = new SqlDataAdapter();&lt;br /&gt;
            DataSet dsItem = new DataSet();&lt;br /&gt;
            SqlCommand sqlCmd = new SqlCommand();&lt;br /&gt;
&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                sqlCmd.Connection = openConnection();&lt;br /&gt;
                sqlCmd.CommandType = commandType;&lt;br /&gt;
                sqlCmd.CommandText = commandText;&lt;br /&gt;
                if(parameterCollection !=null)&lt;br /&gt;
                sqlCmd.Parameters.AddRange(parameterCollection);&lt;br /&gt;
                sqlAdp.SelectCommand = sqlCmd;&lt;br /&gt;
                sqlAdp.Fill(dsItem);&lt;br /&gt;
                return dsItem;&lt;br /&gt;
            }&lt;br /&gt;
            catch (SqlException sqlEx)&lt;br /&gt;
            {&lt;br /&gt;
                throw sqlEx;&lt;br /&gt;
            }&lt;br /&gt;
            catch (Exception ex)&lt;br /&gt;
            {&lt;br /&gt;
                throw ex;&lt;br /&gt;
            }&lt;br /&gt;
            finally&lt;br /&gt;
            {&lt;br /&gt;
                CloseConnection();&lt;br /&gt;
                sqlCmd.Dispose();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        public int ExecuteScaler(CommandType commandType, string commandText, SqlParameter[] parameterCollection)&lt;br /&gt;
        {&lt;br /&gt;
            SqlCommand sqlCmd = new SqlCommand();&lt;br /&gt;
            try&lt;br /&gt;
            {&lt;br /&gt;
                sqlCmd.Connection = openConnection();&lt;br /&gt;
                sqlCmd.CommandType = commandType;&lt;br /&gt;
                sqlCmd.CommandText = commandText;&lt;br /&gt;
                sqlCmd.Parameters.AddRange(parameterCollection);&lt;br /&gt;
                return Convert.ToInt32(sqlCmd.ExecuteScalar().ToString());&lt;br /&gt;
&lt;br /&gt;
            }&lt;br /&gt;
            catch (SqlException sqlEx)&lt;br /&gt;
            {&lt;br /&gt;
                throw sqlEx;&lt;br /&gt;
            }&lt;br /&gt;
            catch (Exception ex)&lt;br /&gt;
            {&lt;br /&gt;
                throw ex;&lt;br /&gt;
            }&lt;br /&gt;
            finally&lt;br /&gt;
            {&lt;br /&gt;
                CloseConnection();&lt;br /&gt;
                sqlCmd.Dispose();&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
///this is the class derived from above class and execute Stored procedures &lt;br /&gt;
using System;&lt;br /&gt;
using System.Collections.Generic;&lt;br /&gt;
using System.Linq;&lt;br /&gt;
using System.Text;&lt;br /&gt;
using Entity;&lt;br /&gt;
using System.Data.SqlClient;&lt;br /&gt;
using System.Data;&lt;br /&gt;
&lt;br /&gt;
namespace DAL&lt;br /&gt;
{&lt;br /&gt;
   public  class CustomerData:DataHelper &lt;br /&gt;
    {&lt;br /&gt;
       public void Save(Entity.Customer cus)&lt;br /&gt;
       {&lt;br /&gt;
           try&lt;br /&gt;
           {&lt;br /&gt;
               SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Cus_name", cus.Cus_Name), new SqlParameter("@Cus_address", cus.Cus_Address), new SqlParameter("@Cus_no", cus.Cus_No)};&lt;br /&gt;
               ExecuteNonQuery(CommandType.StoredProcedure, "INSERT_Customer", para);&lt;br /&gt;
             &lt;br /&gt;
           }&lt;br /&gt;
           catch (SqlException sqlEx)&lt;br /&gt;
           {&lt;br /&gt;
               throw sqlEx;&lt;br /&gt;
           }&lt;br /&gt;
           catch (Exception ex)&lt;br /&gt;
           {&lt;br /&gt;
               throw ex;&lt;br /&gt;
           }&lt;br /&gt;
       }&lt;br /&gt;
       public void Update(Entity.Customer cus)&lt;br /&gt;
       {&lt;br /&gt;
           try&lt;br /&gt;
           {&lt;br /&gt;
               SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Cus_name", cus.Cus_Name), new SqlParameter("@Cus_address", cus.Cus_Address), new SqlParameter("@Cus_no", cus.Cus_No) };&lt;br /&gt;
               ExecuteNonQuery(CommandType.StoredProcedure, "UPDATE_Customer", para);&lt;br /&gt;
&lt;br /&gt;
           }&lt;br /&gt;
           catch (SqlException sqlEx)&lt;br /&gt;
           {&lt;br /&gt;
               throw sqlEx;&lt;br /&gt;
           }&lt;br /&gt;
           catch (Exception ex)&lt;br /&gt;
           {&lt;br /&gt;
               throw ex;&lt;br /&gt;
           }&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
       public DataSet SelectCustomerList()&lt;br /&gt;
       {&lt;br /&gt;
           try&lt;br /&gt;
           {&lt;br /&gt;
               return GetData(CommandType.StoredProcedure, "Select_Customers", null);&lt;br /&gt;
&lt;br /&gt;
           }&lt;br /&gt;
           catch (SqlException sqlEx)&lt;br /&gt;
           {&lt;br /&gt;
               throw sqlEx;&lt;br /&gt;
           }&lt;br /&gt;
           catch (Exception ex)&lt;br /&gt;
           {&lt;br /&gt;
               throw ex;&lt;br /&gt;
           }&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
       public Customer SelectCustomer(string id)&lt;br /&gt;
       {&lt;br /&gt;
           try&lt;br /&gt;
           {&lt;br /&gt;
               SqlParameter[] para = new SqlParameter[] { new SqlParameter("@Cus_No", id) };&lt;br /&gt;
               DataSet dsCus= GetData(CommandType.StoredProcedure, "Select_Customer", para);&lt;br /&gt;
               Customer cus = new Customer();&lt;br /&gt;
               cus.Cus_No = dsCus.Tables[0].Rows[0]["Cus_No"].ToString();&lt;br /&gt;
               cus.Cus_Name = dsCus.Tables[0].Rows[0]["Cus_Name"].ToString();&lt;br /&gt;
               cus.Cus_Address  = dsCus.Tables[0].Rows[0]["Cus_Address"].ToString();&lt;br /&gt;
               return cus;&lt;br /&gt;
               &lt;br /&gt;
           }&lt;br /&gt;
           catch (SqlException sqlEx)&lt;br /&gt;
           {&lt;br /&gt;
               throw sqlEx;&lt;br /&gt;
           }&lt;br /&gt;
           catch (Exception ex)&lt;br /&gt;
           {&lt;br /&gt;
               throw ex;&lt;br /&gt;
           }&lt;br /&gt;
       }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-2131977638981553173?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/H10H-_B5j8w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/2131977638981553173/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2010/05/data-access-layer.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/2131977638981553173?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/2131977638981553173?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/H10H-_B5j8w/data-access-layer.html" title="DATA ACCESS LAYER" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2010/05/data-access-layer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMMRXY4eCp7ImA9WxFTGUw.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-885738572483401551</id><published>2010-04-10T08:13:00.000-07:00</published><updated>2010-04-10T08:14:44.830-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-10T08:14:44.830-07:00</app:edited><title>VS 2008 service pack offline version</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DNF7AH-LdblUu2WrYHkt1rB-PRI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DNF7AH-LdblUu2WrYHkt1rB-PRI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DNF7AH-LdblUu2WrYHkt1rB-PRI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DNF7AH-LdblUu2WrYHkt1rB-PRI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;With fallowing link we can download VS2008 SP1 offline version and it is a .iso file so we need  to burn it in to DVD and install with DVD ROM.&lt;br /&gt;
&lt;a href=" http://www.microsoft.com/downloads/en/confirmation.aspx?familyId=27673c47-b3b5-4c67-bd99-84e525b5ce61&amp;displayLang=en"&gt;VS 2008 SP1&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-885738572483401551?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/AoqjG4XmDvQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/885738572483401551/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2010/04/vs-2008-service-pack-offline-version.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/885738572483401551?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/885738572483401551?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/AoqjG4XmDvQ/vs-2008-service-pack-offline-version.html" title="VS 2008 service pack offline version" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2010/04/vs-2008-service-pack-offline-version.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8MRX4-eip7ImA9WxBbGEk.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-4165137919274295948</id><published>2010-03-11T10:11:00.000-08:00</published><updated>2010-03-17T09:21:24.052-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-17T09:21:24.052-07:00</app:edited><title>COPY EXCELL SHEET DATA TO  MS SQL DATA BASE WITH C#.NET</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/X1Y3_Sb6rKYeJUp9q_5S0R4TOtE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X1Y3_Sb6rKYeJUp9q_5S0R4TOtE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/X1Y3_Sb6rKYeJUp9q_5S0R4TOtE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X1Y3_Sb6rKYeJUp9q_5S0R4TOtE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;using System.Data.SqlClient;
using System.Data;
using System.Data.OleDb;

public class CopyExcellToMSSql
{
string _sourceConnectionString=;
string _destinationConnectionString;

public CopyExcellToMSSql(string sourceConnectionString,
string destinationConnectionString)
{
_sourceConnectionString =
sourceConnectionString;
_destinationConnectionString =
destinationConnectionString;
}

public void CopyTable(string Ftable,string Ttable)
{
using (OleDbConnection source =
new OleDbConnection(_sourceConnectionString))
{
string sql = string.Format("SELECT * FROM [{0}]",
Ftable);

OleDbCommand command = new OleDbCommand(sql, source);

source.Open();
IDataReader dr = command.ExecuteReader();

using (SqlBulkCopy copy =
new SqlBulkCopy(_destinationConnectionString))
{
copy.DestinationTableName = Ttable;
copy.WriteToServer(dr);
}
}
}
}
&lt;/pre&gt;&lt;br /&gt;
Calling above method&lt;br /&gt;
&lt;pre&gt;
public void CopyData{
string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\Documents and Settings\\Dinesh\\Desktop\\D-Garment\\work detailes.xls; Extended Properties=""Excel 8.0;HDR=Yes"";";

string sqlConnectionString ="Data Source=KIT\MYSERVER; Initial Catalog=EMS;User ID=ems; Password=ems123";

CopyExcellToMSSql cpLogic = new CopyExcellToMSSql(excelConnectionString, sqlConnectionString);
cpLogic.CopyTable("Employee$", "TempEMPLOYEE");// Employee is work sheet and "TempEMPLOYEE" is table
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-4165137919274295948?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/CI3JmOkOOAI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/4165137919274295948/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2010/03/copy-excell-sheet-data-to-ms-sql-data.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4165137919274295948?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4165137919274295948?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/CI3JmOkOOAI/copy-excell-sheet-data-to-ms-sql-data.html" title="COPY EXCELL SHEET DATA TO  MS SQL DATA BASE WITH C#.NET" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2010/03/copy-excell-sheet-data-to-ms-sql-data.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUCQH05fip7ImA9WxBVFEo.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-1365385235564164219</id><published>2010-02-17T21:49:00.000-08:00</published><updated>2010-02-17T21:51:01.326-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-17T21:51:01.326-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Insert Multiple Rows to Table in SQL</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ibKSrQtyVomLOjeZJCJ97cJNfkQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ibKSrQtyVomLOjeZJCJ97cJNfkQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ibKSrQtyVomLOjeZJCJ97cJNfkQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ibKSrQtyVomLOjeZJCJ97cJNfkQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre&gt;INSERT INTO [tabale1]
([col1]
,[col2]
,[col3]
,[col4])

(SELECT '11','1','1','1' UNION ALL 
SELECT '22','2','2','2')
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-1365385235564164219?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/fYTi5K2l96E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/1365385235564164219/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2010/02/insert-multiple-rows-to-table-in-sql.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/1365385235564164219?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/1365385235564164219?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/fYTi5K2l96E/insert-multiple-rows-to-table-in-sql.html" title="Insert Multiple Rows to Table in SQL" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2010/02/insert-multiple-rows-to-table-in-sql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8NR304cSp7ImA9WxBSGE8.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-1803609995134848442</id><published>2009-11-02T22:16:00.000-08:00</published><updated>2009-12-26T03:44:56.339-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T03:44:56.339-08:00</app:edited><title>How to call Dynamic Javascript Function from Gridview - Asp.Net</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YCKIMXmh8W9tMJ992cionbLIsPE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YCKIMXmh8W9tMJ992cionbLIsPE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YCKIMXmh8W9tMJ992cionbLIsPE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YCKIMXmh8W9tMJ992cionbLIsPE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;We can call dynamic java script&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0072227907&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt; function from grid view as fallow.say we need to call following  java script function dynamically from gride view then we need to create java script function in .aspx page.&lt;br /&gt;
&lt;pre&gt;&amp;lt;script type="text/jscript"&amp;gt;
function funcShow(id)
{
aleart(id);
}
&amp;lt;/script&amp;gt;
&lt;/pre&gt;After that we have to add  Template filed with Hyperlink  filed to Grdeview  as fallowing &lt;pre&gt;&amp;lt;asp:GridView ID="dg1" runat="server"                      
&amp;lt;Columns&amp;gt;
&amp;lt;asp:BoundField DataField="FileName" HeaderText="Description"&amp;gt;
&amp;lt;/asp:BoundField&amp;gt;
&amp;lt;asp:TemplateField&amp;gt;
&amp;lt;ItemTemplate&amp;gt;
&amp;lt;asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl='&amp;lt;%# RetrunClick(Eval("ID"))%&amp;gt;'&amp;gt;Click&amp;lt;/asp:HyperLink&amp;gt;
&amp;lt;/ItemTemplate&amp;gt;
&amp;lt;/asp:TemplateField&amp;gt;
&amp;lt;/Columns&amp;gt;
&amp;lt;/asp:GridView&amp;gt;
&lt;/pre&gt;Then we need to add following function to the code behind page that will call the java script function .&lt;br /&gt;
&lt;pre&gt;public string RetrunClick(object obj)
{
string str = string.Empty;
if (obj != null)
{
str = "javascript:funcShow('" + obj.ToString() + "')";
}
return str;
}
&lt;/pre&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596527748&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=1590599454&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;a imageanchor="1" target="_blank"  href="http://www.amazon.com/JavaScript-Bible-Fifth-Danny-Goodman/dp/0764557432?ie=UTF8&amp;tag=it0d7-20&amp;link_code=bil&amp;camp=213689&amp;creative=392969"&gt;&lt;img alt="JavaScript Bible, Fifth Edition" src="http://ws.amazon.com/widgets/q?MarketPlace=US&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL160_&amp;ASIN=0764557432&amp;tag=it0d7-20" /&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=it0d7-20&amp;l=bil&amp;camp=213689&amp;creative=392969&amp;o=1&amp;a=0764557432" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;a imageanchor="1" target="_blank"  href="http://www.amazon.com/JavaScript-Bible-Danny-Goodman/dp/0470069163?ie=UTF8&amp;tag=it0d7-20&amp;link_code=bil&amp;camp=213689&amp;creative=392969"&gt;&lt;img alt="JavaScript Bible" src="http://ws.amazon.com/widgets/q?MarketPlace=US&amp;ServiceVersion=20070822&amp;ID=AsinImage&amp;WS=1&amp;Format=_SL160_&amp;ASIN=0470069163&amp;tag=it0d7-20" /&gt;&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=it0d7-20&amp;l=bil&amp;camp=213689&amp;creative=392969&amp;o=1&amp;a=0470069163" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-1803609995134848442?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/mHN28ITd9nM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/1803609995134848442/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/11/how-to-call-dynamic-javascript-function.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/1803609995134848442?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/1803609995134848442?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/mHN28ITd9nM/how-to-call-dynamic-javascript-function.html" title="How to call Dynamic Javascript Function from Gridview - Asp.Net" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/11/how-to-call-dynamic-javascript-function.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIFQX8ycCp7ImA9WxBSGE8.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-4546265106718640635</id><published>2009-10-14T04:19:00.000-07:00</published><updated>2009-12-26T03:55:10.198-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-26T03:55:10.198-08:00</app:edited><title>Calculate Running Sum of the Texboxses in the ASP.NET with Javascript</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BMvWQRxx1jmViyT_3O4Qm4gJRiI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BMvWQRxx1jmViyT_3O4Qm4gJRiI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BMvWQRxx1jmViyT_3O4Qm4gJRiI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BMvWQRxx1jmViyT_3O4Qm4gJRiI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;If we need to get running total of the text boxes in asp.net page while allowing automatically calculate the sum when changed the any text box .&lt;br /&gt;
Ex:&lt;br /&gt;
we have 3 Text Boxes as "txtCallCharges","txtRentTaxies","txtTotalAmount" and we need to get sum of the entered values to the "txtTotalAmount" text box .and also It should be allowed to automatically get total when text changed in nay text box.&lt;br /&gt;
Solution:&lt;br /&gt;
Add following code to the  Code behind page.&lt;br /&gt;
&lt;pre&gt;protected override void OnLoad(EventArgs e)
{
txtCallCharges.Attributes.Add("onblur", "javascript:calculateTotal();");
txtRentTaxies.Attributes.Add("onblur", "javascript:calculateTotal();");
}
&lt;/pre&gt;&lt;br /&gt;
Then add following javascript to  .aspx page&lt;br /&gt;
&lt;pre&gt;function calculateTotal()
{
var ctrl1 = null;
var ctrl2=null;
var ctrl3=null;          
ctrl1= document.getElementById("&lt;%=txtCallCharges.ClientID %&gt;");
ctrl2= document.getElementById("&lt;%=txtRentTaxies.ClientID %&gt;");
ctrl3= document.getElementById("&lt;%=txtTotalAmount.ClientID %&gt;");
var total =null;
if(ctrl1.value != "")
{
total=total+parseFloat(ctrl1.value);
}
if(ctrl2.value != "")
{
total=total+parseFloat(ctrl2.value);
}
ctrl3.value= total;
}&lt;/pre&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=0596527748&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=1590597273&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=047018759X&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=it0d7-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=1590598911&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;" align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-4546265106718640635?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/AC2UvmqcyA4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/4546265106718640635/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/10/calculate-running-sum-of-texboxses-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4546265106718640635?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4546265106718640635?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/AC2UvmqcyA4/calculate-running-sum-of-texboxses-in.html" title="Calculate Running Sum of the Texboxses in the ASP.NET with Javascript" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/10/calculate-running-sum-of-texboxses-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHRHY8eip7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-7036360916964250029</id><published>2009-10-08T03:38:00.000-07:00</published><updated>2009-10-15T22:38:55.872-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:55.872-07:00</app:edited><title>Update multiple columns of one table from another table- SQL</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LNGFOox-VlqcJJBsE3Dr22aRMdU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LNGFOox-VlqcJJBsE3Dr22aRMdU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LNGFOox-VlqcJJBsE3Dr22aRMdU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LNGFOox-VlqcJJBsE3Dr22aRMdU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;UPDATE [tableA]&lt;br /&gt;SET   &lt;br /&gt;    A1 = B.B1+B.B2,&lt;br /&gt;       A2=B.B3&lt;br /&gt;FROM tableA, tableB as B WHERE tableA.ID = B.ID&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-7036360916964250029?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/I-JRyx5v4f0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/7036360916964250029/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/10/update-multiple-columns-of-one-table.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7036360916964250029?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7036360916964250029?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/I-JRyx5v4f0/update-multiple-columns-of-one-table.html" title="Update multiple columns of one table from another table- SQL" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/10/update-multiple-columns-of-one-table.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHRHc5eSp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-7068084306974164008</id><published>2009-06-18T03:17:00.000-07:00</published><updated>2009-10-15T22:38:55.921-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:55.921-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>Refresh a content page without refreshing master page Vs  Avoid flicker when click on the link</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/OoIohTrsL5p8A9NODgNyW47fATA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OoIohTrsL5p8A9NODgNyW47fATA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/OoIohTrsL5p8A9NODgNyW47fATA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/OoIohTrsL5p8A9NODgNyW47fATA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;The master page class derives from the UserControl class. When the application is executing, the master page just like a child control. So we can say the master page is not a true page. “.And, when the page loads, we can notice the navigationURL of the Browser address bar  is the content page's, but not the master page's.Because of that we cannot refresh a content page without refreshing master page .But we can avoid flickering with fallowing code by put one  &amp;lt;HEAD&amp;gt; tag in the master page.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;&amp;lt;meta http-equiv="Page-Enter" content="blendTrans(Duration=0)"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;&amp;lt;meta http-equiv="Page-Exit" content="blendTrans(Duration=0)"/&amp;gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-7068084306974164008?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/hzIq_TK3eS0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/7068084306974164008/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/06/refresh-content-page-without-refreshing.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7068084306974164008?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7068084306974164008?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/hzIq_TK3eS0/refresh-content-page-without-refreshing.html" title="Refresh a content page without refreshing master page Vs  Avoid flicker when click on the link" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/06/refresh-content-page-without-refreshing.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHRHc4eip7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-6424316875606718733</id><published>2009-06-05T03:16:00.000-07:00</published><updated>2009-10-15T22:38:55.932-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:55.932-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET" /><title>ASP.NET Master page Set Background Image to Table</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KearbWcsQjek7OH31WBSVwurt_s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KearbWcsQjek7OH31WBSVwurt_s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KearbWcsQjek7OH31WBSVwurt_s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KearbWcsQjek7OH31WBSVwurt_s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-weight: bold;"&gt;Problem &lt;/span&gt;:When we set ASP Net - Master Page background image it only visible from pages in root directory&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span&gt;&lt;span style="font-weight: bold;"&gt;Solution&lt;/span&gt; &lt;/span&gt;: &lt;span&gt;The images which are used in Masterpage should be &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;set  in the code behind file as fallow .&lt;br /&gt;The runat='Server" attribute should be added to the controller which are going to set background image and ID should be set to that controller.&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);font-size:100%;" &gt;&amp;lt;td runat="server"  id="tb1"&amp;gt;set back ground image with code&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;In the code behind page    image should be set using ResolveClientUrl() method&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    {&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;        tb1.Style[HtmlTextWriterStyle.BackgroundImage] = ResolveClientUrl("~/App_Themes/Images/1-sri-lanka.JPG");&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;    }&lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;!-- google_ad_section_start --&gt;&lt;h1 style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-6424316875606718733?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/z8nkg-FP2Hc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/6424316875606718733/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/06/aspnet-master-page-set-background-image.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6424316875606718733?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6424316875606718733?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/z8nkg-FP2Hc/aspnet-master-page-set-background-image.html" title="ASP.NET Master page Set Background Image to Table" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/06/aspnet-master-page-set-background-image.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHRHc6eCp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-5882530917155782499</id><published>2009-06-02T02:39:00.000-07:00</published><updated>2009-10-15T22:38:55.910-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:55.910-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>Sql Date Time  Formatting</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/73emxUoG9d47cmwFvOSsdN-FKgs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/73emxUoG9d47cmwFvOSsdN-FKgs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/73emxUoG9d47cmwFvOSsdN-FKgs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/73emxUoG9d47cmwFvOSsdN-FKgs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;Remove Time Part From DateTime &lt;/span&gt;&lt;br /&gt;---------------------------------&lt;br /&gt;SELECT GETDATE() /// &lt;span style="color: rgb(0, 0, 153);"&gt;2009-06-25 12:03:56.640&lt;/span&gt;&lt;br /&gt;Declare @mydate DATETIME&lt;br /&gt;SET @mydate=GETDATE()&lt;br /&gt;&lt;br /&gt;------------------------------------- &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.Get Out put as Type of DateTime with zero time&lt;/span&gt;&lt;br /&gt;SELECT DATEADD(day, DATEDIFF(day, '20000101',@mydate), '20000101')&lt;br /&gt;or&lt;br /&gt;SELECT DATEADD(DAY, 0, DATEDIFF(DAY,0,@mydate))&lt;br /&gt;or&lt;br /&gt;SELECT DATEADD(dd, DATEDIFF(dd, 0, @mydate), 0)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;out put :2009-06-25 00:00:00.000&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.Get Out put as Type of Varchar without time&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT  CONVERT(VARCHAR(10),@mydate, 103)&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;out put :25/06/2009&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Or&lt;br /&gt;SELECT CONVERT(VARCHAR(10), @mydate, 120)&lt;br /&gt;&lt;span style="color: rgb(51, 51, 153);"&gt;out put :2009-06-25&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-5882530917155782499?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/m7OsxR9-0B4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/5882530917155782499/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/06/sql-date-time-formatting.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/5882530917155782499?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/5882530917155782499?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/m7OsxR9-0B4/sql-date-time-formatting.html" title="Sql Date Time  Formatting" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/06/sql-date-time-formatting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHRHc8fip7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-7257864774164032904</id><published>2009-05-10T22:23:00.000-07:00</published><updated>2009-10-15T22:38:55.976-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:55.976-07:00</app:edited><title>Unique Identifier In .Net  &amp; SQL</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ke4xlKJfX-hqsIptjYJX7fcomDk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ke4xlKJfX-hqsIptjYJX7fcomDk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ke4xlKJfX-hqsIptjYJX7fcomDk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ke4xlKJfX-hqsIptjYJX7fcomDk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;A GUID (Globally Unique Identifiers) is a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated. In the .NET framework the System.Guid.NewGuid method is used to generate the unique identifiers.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 255);font-size:85%;" &gt;System.Guid desiredGuid = System.Guid.NewGuid();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This desiredGuid can be directly save to DB. The data type of the filed should be  “uniqueidentifier” or we can cast it as string …. And also we can store GUID in “System.Guid” data type variable(C#).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;convert &lt;/span&gt;&lt;span style="font-weight: bold;font-size:85%;" &gt;GUID to Sting &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);font-size:85%;" &gt; System.Guid  desiredGuid = System.Guid.NewGuid();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 204);"&gt; string a=&lt;/span&gt;&lt;span style="color: rgb(102, 102, 204);font-size:85%;" &gt;desiredGuid.ToString();&lt;/span&gt; &lt;p&gt;&lt;span style="font-weight: bold;"&gt;convert a string to a GUID&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(153, 153, 255);font-size:85%;" &gt;Guid MyGuid = &lt;span class="operators"&gt;new&lt;/span&gt; Guid(stringValue);&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;In SQL Server, the “uniqueidentifier” data type is used to store the GUIDs and newid() function will generate GUID.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-7257864774164032904?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/O3gvm0BIQ7A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/7257864774164032904/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/05/unique-identifier-in-net-sql.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7257864774164032904?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7257864774164032904?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/O3gvm0BIQ7A/unique-identifier-in-net-sql.html" title="Unique Identifier In .Net  &amp;amp; SQL" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/05/unique-identifier-in-net-sql.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0MGRn85eSp7ImA9WxNUEk4.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-4326312294478693698</id><published>2009-03-19T22:59:00.000-07:00</published><updated>2009-11-02T22:57:07.121-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-02T22:57:07.121-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><title>TypeForwardedTo (.NET)</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RSHqPJSdDLZfctw4RglYvXL2jWk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RSHqPJSdDLZfctw4RglYvXL2jWk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RSHqPJSdDLZfctw4RglYvXL2jWk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RSHqPJSdDLZfctw4RglYvXL2jWk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;We can use this class to move type from one assembly to another while not disrupting the callers compile against the original assembly .&lt;br /&gt;Example : we have a source library (say lib.dll)  which included lot of classes and we have use that class library for our application development. After some period of time the we refastening the source library (lib.dll) and it splits in to two source library to (say lib.dll and lib1.dll) .Then what happen to our application will it work? No because our application point to the lib.dll but some of the classes have move to lib1.dll to. So our application will generate error .To prevent this we can use “TypeForwardedTo”&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Following 2 classes define in lib.dll&lt;/span&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace lib&lt;br /&gt;{&lt;br /&gt;  public class car&lt;br /&gt;  {&lt;br /&gt;      public static void Do()&lt;br /&gt;      {&lt;br /&gt;          System.Console.WriteLine("car");&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;      public class van&lt;br /&gt;      {&lt;br /&gt;      public static void Do()&lt;br /&gt;       {&lt;br /&gt;          System.Console.WriteLine("van");       &lt;br /&gt;       }&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then the develop application using above lib.dll as following&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using lib;&lt;br /&gt;&lt;br /&gt;namespace ConsoleApplication3&lt;br /&gt;{&lt;br /&gt;  class Program&lt;br /&gt;  {&lt;br /&gt;      static void Main(string[] args)&lt;br /&gt;      {&lt;br /&gt;          car.Do();&lt;br /&gt;          van.Do();&lt;br /&gt;          Console.ReadLine();&lt;br /&gt;        &lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The Out put is :&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;car&lt;br /&gt;van&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Now we split above lib.dll to 2 dll to as following&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;lib.dll&lt;/span&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace lib&lt;br /&gt;{&lt;br /&gt;  public class car&lt;br /&gt;  {&lt;br /&gt;      public static void Do()&lt;br /&gt;      {&lt;br /&gt;          System.Console.WriteLine("car");&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;  }     &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;lib1.dll&lt;/span&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;namespace lib1&lt;br /&gt;{&lt;br /&gt;  public class van&lt;br /&gt;  {&lt;br /&gt;      public static void Do()&lt;br /&gt;      {&lt;br /&gt;          System.Console.WriteLine("van");&lt;br /&gt;&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Then replace the above lib.dll with new two dlls. Now what happen, the van class can’t find in new lib.dll so it generate and error.&lt;br /&gt;So prevent such a error we ca use&lt;br /&gt;“System.Runtime.CompilerServices.TypeForwardedTo” as following&lt;br /&gt;Open the lib project and Open the AssemblyInfo.cs file and add the following line right after the assembly directives.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;[assembly: TypeForwardedTo(typeof(lib1.van))] &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;now build projecj.&lt;br /&gt;Now we have 2dlls, lib.dll and lib1.dll but we can still run oure previouse application without any error .....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-4326312294478693698?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/3h98CniAEM0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/4326312294478693698/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/03/typeforwardedto-net.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4326312294478693698?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/4326312294478693698?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/3h98CniAEM0/typeforwardedto-net.html" title="TypeForwardedTo (.NET)" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/03/typeforwardedto-net.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHRHc-eyp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-6932692816691095096</id><published>2009-02-11T20:40:00.000-08:00</published><updated>2009-10-15T22:38:55.953-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:55.953-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SQL" /><title>SQL Select First and Last 100 Record</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8ttRrm0zBi5Q6MOpd8LPT3B84m0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8ttRrm0zBi5Q6MOpd8LPT3B84m0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8ttRrm0zBi5Q6MOpd8LPT3B84m0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8ttRrm0zBi5Q6MOpd8LPT3B84m0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;u&gt;Select first 100 Records&lt;/u&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;SELECT RecordId&lt;br /&gt;FROM Table&lt;br /&gt;LIMIT 100&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Select Last 100 Records&lt;/u&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;SELECT RecordId&lt;br /&gt;FROM Table&lt;br /&gt;ORDER BY RecordId DESC&lt;br /&gt;LIMIT 100&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-6932692816691095096?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/Epk0klrW_yQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/6932692816691095096/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2009/02/sql-select-first-and-last-100-record.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6932692816691095096?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/6932692816691095096?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/Epk0klrW_yQ/sql-select-first-and-last-100-record.html" title="SQL Select First and Last 100 Record" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2009/02/sql-select-first-and-last-100-record.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IAQXoyfSp7ImA9WxNUEk4.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-7773278252664154546</id><published>2008-07-03T04:56:00.000-07:00</published><updated>2009-11-02T22:59:00.495-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-02T22:59:00.495-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><title>Event and Delegates -Capture Master Page Events in Content Pages</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zEUthFommtFw2kZ7UWNbZPFB_-U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zEUthFommtFw2kZ7UWNbZPFB_-U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zEUthFommtFw2kZ7UWNbZPFB_-U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zEUthFommtFw2kZ7UWNbZPFB_-U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;In This article, I explain how to use event and delegate to capture Master page event at content page.&lt;br /&gt;Case :The master page (MasterPage.master.cs) Content drop down list .When The dropdown selected index change the selected value must be display in content page labels.&lt;br /&gt;How to Do:&lt;br /&gt;1. we develop master page as usual .Then top of code behind page of the master page, we have to declare Delegate and also have to declare public event in the class which type of previous delegate .Next step is declaring virtual method that used to handle the event ,Then we have to call the above method at the event of controller(drop down list ).&lt;br /&gt;2.Develop content page and put following code at the top of .aspx page&lt;br /&gt;3. In the code behind file of content page we have to write method capture to the master page event and in the page load event we have to add event handaler to call .&lt;br /&gt;MasterPage.master.cs&lt;br /&gt;This is Master Page with content Drop down list&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns= " http://www.w3.org/1999/xhtml" &amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Master test&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div style="width: 158px; height: 414px; background-color: gray"&amp;gt;&lt;br /&gt;&amp;lt;asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Width="150px"&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem Value="a"&amp;gt;&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem&amp;gt;b&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;asp:ListItem&amp;gt;c&amp;lt;/asp:ListItem&amp;gt;&lt;br /&gt;&amp;lt;/asp:DropDownList&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div style="left: 168px; width: 638px; position: absolute; top: 17px; height: 410px"&amp;gt;&lt;br /&gt;&amp;lt;asp:contentplaceholder id="ContentPlaceHolder1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;/asp:contentplaceholder&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;class MasterPage&lt;br /&gt;Then Put following codes in page behined file of the master page&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;//declare delegates for Master Page Events&lt;br /&gt;public delegate void mstDelegate(object sender, System.EventArgs e);&lt;br /&gt;public partial class MasterPage : System.Web.UI.MasterPage&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;private string slectedValue;&lt;br /&gt;public string SlectedValue&lt;br /&gt;{&lt;br /&gt;get { return slectedValue; }&lt;br /&gt;set { slectedValue = value; }&lt;br /&gt;}&lt;br /&gt;// declare Public Events type of above delegate&lt;br /&gt;public event mstDelegate DropDownEvent;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;// impliment virtual method to handel above event&lt;br /&gt;protected virtual void OnDropDownClick(EventArgs e)&lt;br /&gt;{&lt;br /&gt;if (DropDownEvent != null)&lt;br /&gt;{&lt;br /&gt;//Invokes the delegates.&lt;br /&gt;DropDownEvent(this, e);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// DropDownList1_SelectedIndexChanged event&lt;br /&gt;protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;SlectedValue = DropDownList1.SelectedValue;&lt;br /&gt;OnDropDownClick(e);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Create Test page&lt;br /&gt;testevent.aspx&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;%@ MasterType virtualPath="~/MasterPage.master"%&amp;gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="testevent.aspx.cs" Inherits="testevent" Title="test Page" %&amp;gt;&lt;br /&gt;&amp;lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="lblOutput" runat="server" Text="Label" Width="244px"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;/asp:Content&amp;gt;&lt;br /&gt;Code behind file of test page&lt;br /&gt;Testevent.cs&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;public partial class testevent : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;// create instant of Master event&lt;br /&gt;Master.DropDownEvent += new mstDelegate(mstDDLClick);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;/// method for catch Master Page menu click event&lt;br /&gt;void mstDDLClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;lblOutput.Text = Master.SlectedValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-7773278252664154546?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/gpNigDuDKOA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/7773278252664154546/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2008/07/event-and-delegates-capture-master-page.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7773278252664154546?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/7773278252664154546?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/gpNigDuDKOA/event-and-delegates-capture-master-page.html" title="Event and Delegates -Capture Master Page Events in Content Pages" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2008/07/event-and-delegates-capture-master-page.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHR347eip7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-5658005490098695304</id><published>2008-06-02T05:11:00.000-07:00</published><updated>2009-10-15T22:38:56.002-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:56.002-07:00</app:edited><title>Set a Date Format In GridView Using ASP.NET</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/03bgQgDV-fYJmKozLEwbrlnigM8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/03bgQgDV-fYJmKozLEwbrlnigM8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/03bgQgDV-fYJmKozLEwbrlnigM8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/03bgQgDV-fYJmKozLEwbrlnigM8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-weight:bold;"&gt;Following code explain How to format date in ASP.Net Gride view &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt; asp :GridView ID=“GridView1″ runat=“server”  &gt;&lt;br /&gt;&lt; columns  &gt;&lt;br /&gt;  &lt;  asp :BoundField DataField=“CreationDate”  &lt;br /&gt;     DataFormatString=“{0:dd-MM-yyyy}”  &lt;br /&gt;     HtmlEncode=“false”&lt;br /&gt;     HeaderText=“CreationDate”       /&gt;&lt;br /&gt;&lt;  /columns  &gt;&lt;br /&gt;&lt;  /asp  &gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-5658005490098695304?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/aYCJfhLHuG0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/5658005490098695304/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2008/06/set-date-format-in-gridview-using.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/5658005490098695304?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/5658005490098695304?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/aYCJfhLHuG0/set-date-format-in-gridview-using.html" title="Set a Date Format In GridView Using ASP.NET" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2008/06/set-date-format-in-gridview-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHR34_fyp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-9047796785030967179</id><published>2008-04-21T05:48:00.000-07:00</published><updated>2009-10-15T22:38:56.047-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:56.047-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><title>Passing Parameters to Crystal Reports</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kq42dt7FSJ0IgHQu2iMai8JoYrE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kq42dt7FSJ0IgHQu2iMai8JoYrE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kq42dt7FSJ0IgHQu2iMai8JoYrE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kq42dt7FSJ0IgHQu2iMai8JoYrE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;It is seam to be passing parameters to crystal reports (without prompting Enter to parameter values) programmatically some what confusing. So in this article I’ll explain Step by step “how to pass parameters to crystal reports”. We need to import following namespace.&lt;br /&gt;using CrystalDecisions.CrystalReports.Engine;&lt;br /&gt;&lt;br /&gt;Then following code pass the parameter value to crystal reports.&lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e){&lt;br /&gt;        this.CrystalReportViewer1.ParameterFieldInfo.Clear();&lt;br /&gt;        ParameterDiscreteValue desValue1= new ParameterDiscreteValue();&lt;br /&gt;        desValue1.Value = "Testing";// set value for parameter&lt;br /&gt;        ParameterField  paraFld = new ParameterField();&lt;br /&gt;        paraFld.Name = "User";// this is parameter name &lt;br /&gt;        paraFld.CurrentValues.Add(desValue1);&lt;br /&gt;        paraFld.HasCurrentValue = true;       &lt;br /&gt;        this.CrystalReportViewer1.ParameterFieldInfo.Add(paraFld);&lt;br /&gt;        this.CrystalReportViewer1.ShowFirstPage(); &lt;br /&gt;}   &lt;br /&gt;&lt;br /&gt;If we have more than two parameters it is bit difficult .So we can write common Method to passé parameters to crystal report as follow.&lt;br /&gt;&lt;br /&gt;  Public Void SetParameter(string ParaName ,string ParaValue)&lt;br /&gt;{&lt;br /&gt;       ParameterDiscreteValue desValue= new ParameterDiscreteValue();&lt;br /&gt;      desValue. Value= ParaValue;&lt;br /&gt;      ParameterField  paraFld = new ParameterField();&lt;br /&gt;      paraFld.Name = ParaName;&lt;br /&gt;      paraFld.CurrentValues.Add(desValue);&lt;br /&gt;      paraFld.HasCurrentValue = true;    &lt;br /&gt;      CrystalReportViewer1.ParameterFieldInfo.Add(paraFld);&lt;br /&gt;   &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;By using above method we can pass any number of parameters very easily.&lt;br /&gt;As following (Think, ReportName and Createdby are two parameters which we defined in crystal reports) Then &lt;br /&gt;&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;            this.CrystalReportViewer1.ParameterFieldInfo.Clear();&lt;br /&gt;SetParameter(“ReportName”,”My First Report”);//               SetParameter(“Createdby”,”Dinesh”);&lt;br /&gt;        this.CrystalReportViewer1.ShowFirstPage(); &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;  &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-9047796785030967179?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/MMQr9ZG5o3c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/9047796785030967179/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2008/04/passing-parameters-to-crystal-reports.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/9047796785030967179?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/9047796785030967179?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/MMQr9ZG5o3c/passing-parameters-to-crystal-reports.html" title="Passing Parameters to Crystal Reports" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2008/04/passing-parameters-to-crystal-reports.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHR34-cSp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-3460875590592185610</id><published>2008-01-12T02:10:00.000-08:00</published><updated>2009-10-15T22:38:56.059-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:56.059-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>Log4j</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vgwvc8YM7Km7vMRlGv3JmY8AvnY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vgwvc8YM7Km7vMRlGv3JmY8AvnY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vgwvc8YM7Km7vMRlGv3JmY8AvnY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vgwvc8YM7Km7vMRlGv3JmY8AvnY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Inserting log statements into your code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is often the case for distributed applications.&lt;br /&gt;&lt;br /&gt;With log4j it is possible to enable logging at runtime without modifying the application binary. The log4j package is designed so that these statements can remain in shipped code without incurring a heavy performance cost. Logging behavior can be controlled by editing a configuration file, without touching the application binary.&lt;br /&gt;so first we need to download log 4j jar file  and put it into lib directory .&lt;br /&gt;http://logging.apache.org/log4j/1.2/download.html" &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Configure Log4j with Xml file &lt;/span&gt;&lt;br /&gt;To configure log4j only we  need to copy following log4j.xml file to  &lt;span style="font-weight: bold;"&gt;src &lt;/span&gt;folder of project. And edit the location which the log message should be write as &lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt; param name="File" value="../webapps/myporject/info.log &gt;&lt;/span&gt;   in the log4j.xml file .&lt;br /&gt;&lt;br /&gt;log4j.xml&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt; ? xml version="1.0" encoding="UTF-8" ?&gt;&lt;br /&gt;&lt; !DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;&lt;br /&gt;&lt; log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j / ' &gt;&lt;br /&gt;&lt;br /&gt;  &lt; appender name="STDOUT" class="org.apache.log4j.ConsoleAppender" &gt;&lt;br /&gt;    &lt; layout class="org.apache.log4j.PatternLayout"&gt;&lt;br /&gt;          &lt; param name="ConversionPattern" value="%p-- %c %d{ISO8601}-- %m%n" / &gt;&lt;br /&gt;    &lt; /layout&gt;&lt;br /&gt;  &lt; /appender&gt;&lt;br /&gt;&lt;br /&gt;  &lt; appender name="INFO" class="org.apache.log4j.RollingFileAppender"&gt;&lt;br /&gt;     &lt; param name="File" value="../&lt;span style="font-style:italic;"&gt;webapps/myporject/info.log&lt;/span&gt;"/&gt; // the location and file name&lt;br /&gt;     &lt; param name="Append" value="true" / &gt;&lt;br /&gt;     &lt; param name="MaxFileSize" value="5000KB" / &gt;&lt;br /&gt;     &lt; param name="MaxBackupIndex" value="2"/&gt;&lt;br /&gt;    &lt; layout class="org.apache.log4j.PatternLayout"&gt;&lt;br /&gt;          &lt; param name="ConversionPattern" value=" %p --%c-- %d{ISO8601} -- %m%n" / &gt;&lt;br /&gt;    &lt; /layout&gt;&lt;br /&gt;    &lt; filter class="org.apache.log4j.varia.LevelRangeFilter" &gt;&lt;br /&gt;      &lt; param name="LevelMin" value="INFO"  / &gt;&lt;br /&gt;    &lt; /filter&gt;&lt;br /&gt;  &lt; /appender&gt;&lt;br /&gt;&lt;br /&gt;  &lt; appender name="DEBUG" class="org.apache.log4j.RollingFileAppender &gt;&lt;br /&gt;     &lt;span style="font-style:italic;"&gt;&lt; param name="File" value=" value="../webapps/myporject/logs/debug.log"/ &gt;&lt;/span&gt;&lt;br /&gt;     &lt; param name="Append" value="true"/&gt;&lt;br /&gt;     &lt; param name="MaxFileSize" value="5000KB"/ &gt;&lt;br /&gt;     &lt; param name="MaxBackupIndex" value="2"/  &gt;&lt;br /&gt;    &lt; layout class="org.apache.log4j.PatternLayout"  &gt;&lt;br /&gt;          &lt; param name="ConversionPattern" value=" %p--%c %d{ISO8601} -- %m%n"/  &gt;&lt;br /&gt;    &lt; /layout&gt;&lt;br /&gt;    &lt; filter class="org.apache.log4j.varia.LevelRangeFilter"  &gt;&lt;br /&gt;      &lt; param name="LevelMin" value="DEBUG" /  &gt;&lt;br /&gt;    &lt; /filter&gt;&lt;br /&gt;  &lt; /appender&gt;&lt;br /&gt;&lt;br /&gt;  &lt; appender name="FATAL" class="org.apache.log4j.RollingFileAppender"  &gt;&lt;br /&gt;    &lt;span style="font-style:italic;"&gt; &lt; param name="File" value=" value="../webapps/myporject/logs/fatal.log"/  &gt;&lt;/span&gt;&lt;br /&gt;     &lt; param name="Append" value="true"/  &gt;&lt;br /&gt;     &lt; param name="MaxFileSize" value="5000KB"/  &gt;&lt;br /&gt;     &lt; param name="MaxBackupIndex" value="2"/  &gt;&lt;br /&gt;    &lt; layout class="org.apache.log4j.PatternLayout"&gt;&lt;br /&gt;          &lt; param name="ConversionPattern" value=" %p--%c %d{ISO8601} -- %m%n"/  &gt;&lt;br /&gt;    &lt; /layout&gt;&lt;br /&gt;    &lt; filter class="org.apache.log4j.varia.LevelRangeFilter"  &gt;&lt;br /&gt;      &lt; param name="LevelMin" value="FATAL" / &gt;&lt;br /&gt;    &lt; /filter&gt;&lt;br /&gt;  &lt; /appender&gt;&lt;br /&gt;&lt;br /&gt;  &lt; appender name="WARN" class="org.apache.log4j.RollingFileAppender" &gt;&lt;br /&gt;    &lt;span style="font-style:italic;"&gt; &lt; param name="File" value="../webapps/myporject/logs/warn.log"/ &gt;&lt;/span&gt;&lt;br /&gt;     &lt; param name="Append" value="true"/ &gt;&lt;br /&gt;     &lt; param name="MaxFileSize" value="5000KB"/ &gt;&lt;br /&gt;     &lt; param name="MaxBackupIndex" value="2"/&gt;&lt;br /&gt;    &lt; layout class="org.apache.log4j.PatternLayout" &gt;&lt;br /&gt;          &lt; param name="ConversionPattern" value=" %p--%c %d{ISO8601}  -- %m%n"/ &gt;&lt;br /&gt;    &lt; /layout&gt;&lt;br /&gt;    &lt; filter class="org.apache.log4j.varia.LevelRangeFilter" &gt;&lt;br /&gt;      &lt; param name="LevelMin" value="WARN" /&gt;&lt;br /&gt;    &lt; /filter&gt;&lt;br /&gt;  &lt; /appender&gt;&lt;br /&gt;&lt;br /&gt;  &lt; appender name="ERROR" class="org.apache.log4j.RollingFileAppender"  &gt;&lt;br /&gt;   &lt;span style="font-style:italic;"&gt;  &lt; param name="File" value="../webapps/myporject/logs/error.log"/  &gt;&lt;/span&gt;&lt;br /&gt;     &lt; param name="Append" value="true"/ &gt;&lt;br /&gt;     &lt; param name="MaxFileSize" value="5000KB"/ &gt;&lt;br /&gt;     &lt; param name="MaxBackupIndex" value="2"/ &gt;&lt;br /&gt;    &lt; layout class="org.apache.log4j.PatternLayout"&gt;&lt;br /&gt;          &lt; param name="ConversionPattern" value="%p--%c %d{ISO8601} -- %m%n"/  &gt;&lt;br /&gt;    &lt; /layout&gt;&lt;br /&gt;    &lt; filter class="org.apache.log4j.varia.LevelRangeFilter"&gt;&lt;br /&gt;      &lt; param name="LevelMin" value="ERROR" / &gt;&lt;br /&gt;    &lt; /filter&gt;&lt;br /&gt;  &lt; /appender&gt;&lt;br /&gt;&lt;br /&gt;  &lt; root&gt;&lt;br /&gt;    &lt; priority value="ALL"/&gt;&lt;br /&gt;    &lt; appender-ref ref="DEBUG"/&gt;&lt;br /&gt;    &lt; appender-ref ref="FATAL"/&gt;&lt;br /&gt;    &lt; appender-ref ref="INFO"/&gt;&lt;br /&gt;    &lt; appender-ref ref="WARN"/&gt;&lt;br /&gt;    &lt; appender-ref ref="ERROR"/&gt;&lt;br /&gt;  &lt; /root&gt;&lt;br /&gt;&lt;br /&gt;&lt; /log4j:configuration&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Put log messages in the Class&lt;/span&gt;&lt;br /&gt;After put above file to src folder in the project.Then we can use log4j as  following code in the progrmme.&lt;br /&gt;&lt;br /&gt;import org.apache.log4j.Logger;&lt;br /&gt;&lt;br /&gt;class testlog()&lt;br /&gt;{&lt;br /&gt;Logger log=new Logger(testlog.class);&lt;br /&gt;log.Infor("&lt;&lt;Log masagee&gt;&gt;&gt;&gt;");// this simply print in specify&lt;br /&gt;                                //locationwebapps/myporject/info.log&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-3460875590592185610?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/zvLVggVOyZw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/3460875590592185610/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2008/01/log4j.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/3460875590592185610?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/3460875590592185610?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/zvLVggVOyZw/log4j.html" title="Log4j" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2008/01/log4j.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHR348fSp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-737511352106994308</id><published>2007-12-10T21:53:00.000-08:00</published><updated>2009-10-15T22:38:56.075-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:56.075-07:00</app:edited><title>Windows From Mouse Right Click pop up menu in c#</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aQ5j2ANgdZlMFHHe56kf5MpeDfk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aQ5j2ANgdZlMFHHe56kf5MpeDfk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aQ5j2ANgdZlMFHHe56kf5MpeDfk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aQ5j2ANgdZlMFHHe56kf5MpeDfk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;Muse right click menu&lt;br /&gt;&lt;br /&gt;1.Create Menu in design view (by adding "ContextMenu" control onto the  form in the design view )&lt;br /&gt;2.add following code( MouseUp event of the form)&lt;br /&gt;&lt;br /&gt;private void Form1_MouseUp(object sender, MouseEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (e.Button == MouseButtons.Right)&lt;br /&gt;            {&lt;br /&gt;                contextMenuStrip1.Show(this,e.X, e.Y);&lt;br /&gt;            }&lt;br /&gt;        }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-737511352106994308?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/24mIVTQKoOk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/737511352106994308/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2007/12/windows-from-mouse-right-click-pop-up.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/737511352106994308?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/737511352106994308?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/24mIVTQKoOk/windows-from-mouse-right-click-pop-up.html" title="Windows From Mouse Right Click pop up menu in c#" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2007/12/windows-from-mouse-right-click-pop-up.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0IHR387eCp7ImA9WxNWFko.&quot;"><id>tag:blogger.com,1999:blog-8222837713253542135.post-1081840795811194562</id><published>2007-12-05T02:38:00.000-08:00</published><updated>2009-10-15T22:38:56.100-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-15T22:38:56.100-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java" /><title>Tomcat configaration</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/x5l2gmsffS0cXByFsLnyT48fslc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x5l2gmsffS0cXByFsLnyT48fslc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/x5l2gmsffS0cXByFsLnyT48fslc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/x5l2gmsffS0cXByFsLnyT48fslc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;1.Install java 1.5 0r 1.6&lt;br /&gt;2.set PATH by putting following line to c:\autoexec.bat file.(use JDK1.5)&lt;br /&gt;&lt;br /&gt;set PATH="C:\Program Files\Java\jdk1.5.0_07\bin";%PATH%&lt;br /&gt;&lt;br /&gt;3.Check configured properly  by using  "java -version" and "javac -help" in command prompt.Make sure  not an error message about an unknown command.&lt;br /&gt;&lt;br /&gt;4.Go to  http://tomcat.apache.org/download-60.cgi and download and unpack the zip file  to C:\apache-tomcat-6.0.10 (current version of tomcat 6.0.10)&lt;br /&gt;&lt;br /&gt;5.set  JAVA_HOME directory by putting following line to c:\autoexec.bat file &lt;br /&gt; &lt;br /&gt;   set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6.Turn on Servlet Reloading&lt;br /&gt; &lt;br /&gt;To turn on servlet reloading, edit Edit C:\apache-tomcat-6.0.14\conf\context.xml and change&lt;br /&gt;&lt;br /&gt;&lt; Context &gt; &lt;br /&gt;to&lt;br /&gt;&lt; Context reloadable="true" privileged="true" &gt;&lt;br /&gt;&lt;br /&gt;7.Now in the command prompt&lt;br /&gt;&lt;br /&gt;C:\&gt;AUTOEXEC.BAT&lt;br /&gt;C:\apache-tomcat-6.0.14\bin&gt;startup.bat&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8222837713253542135-1081840795811194562?l=dineshkumara.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/nUrJ/~4/7SpgJfja_Ts" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://dineshkumara.blogspot.com/feeds/1081840795811194562/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://dineshkumara.blogspot.com/2007/12/tomcat-configaration.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/1081840795811194562?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8222837713253542135/posts/default/1081840795811194562?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/nUrJ/~3/7SpgJfja_Ts/tomcat-configaration.html" title="Tomcat configaration" /><author><name>Dinesh Kumara(B.Sc, BIT,MCP)</name><uri>http://www.blogger.com/profile/15425028365108486835</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://dineshkumara.blogspot.com/2007/12/tomcat-configaration.html</feedburner:origLink></entry></feed>

