<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-610357705230754183</id><updated>2025-09-30T19:08:50.541+03:00</updated><category term=".Net"/><category term=".Net Core"/><category term="Core"/><category term="Deployment"/><category term="Publish"/><title type='text'>Programming With C# Tricks</title><subtitle type='html'>This blog for some tricks of C# , SQL Server and ASP.NET which i faced before to make this blog a good reference for me and share it with you.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-7579463270438073387</id><published>2020-01-09T12:00:00.000+02:00</published><updated>2020-01-09T12:00:27.791+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".Net"/><category scheme="http://www.blogger.com/atom/ns#" term=".Net Core"/><category scheme="http://www.blogger.com/atom/ns#" term="Core"/><category scheme="http://www.blogger.com/atom/ns#" term="Deployment"/><category scheme="http://www.blogger.com/atom/ns#" term="Publish"/><title type='text'>Publishing node_modules in .Net Core</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
How to automate the npm install, when you publish your .net core project,&lt;br /&gt;
and make sure the publish operation include the node_modules folder created&lt;br /&gt;
&lt;br /&gt;
please follow the next steps to do this solution&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;double click on the project or right click on the project and select edit, you will open .csproj file, you will find xml data&lt;/li&gt;
&lt;li&gt;exclude the node_modules from your project&lt;/li&gt;
&lt;li&gt;remove the ItemGroup which contains the reference the node_modules files&lt;/li&gt;
&lt;li&gt;write the following code&lt;table class=&quot;highlight tab-size js-file-line-container&quot; data-tab-size=&quot;8&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 14px; tab-size: 8;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC7&quot; style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; overflow-wrap: normal; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre;&quot;&gt; &amp;lt;&lt;span class=&quot;pl-ent&quot; style=&quot;box-sizing: border-box; color: #22863a;&quot;&gt;Target&lt;/span&gt; &lt;span class=&quot;pl-e&quot; style=&quot;box-sizing: border-box; color: #6f42c1;&quot;&gt;Name&lt;/span&gt;=&lt;span class=&quot;pl-s&quot; style=&quot;box-sizing: border-box; color: #032f62;&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;PostBuild&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-e&quot; style=&quot;box-sizing: border-box; color: #6f42c1;&quot;&gt;AfterTargets&lt;/span&gt;=&lt;span class=&quot;pl-s&quot; style=&quot;box-sizing: border-box; color: #032f62;&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;ComputeFilesToPublish&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-num js-line-number&quot; data-line-number=&quot;8&quot; id=&quot;L8&quot; style=&quot;box-sizing: border-box; color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 50px;&quot;&gt;&lt;table class=&quot;highlight tab-size js-file-line-container&quot; data-tab-size=&quot;8&quot; style=&quot;border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 14px; tab-size: 8;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC8&quot; style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; overflow-wrap: normal; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre;&quot;&gt;    &amp;lt;&lt;span class=&quot;pl-ent&quot; style=&quot;box-sizing: border-box; color: #22863a;&quot;&gt;Exec&lt;/span&gt; &lt;span class=&quot;pl-e&quot; style=&quot;box-sizing: border-box; color: #6f42c1;&quot;&gt;Command&lt;/span&gt;=&lt;span class=&quot;pl-s&quot; style=&quot;box-sizing: border-box; color: #032f62;&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;npm install&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-num js-line-number&quot; data-line-number=&quot;9&quot; id=&quot;L9&quot; style=&quot;box-sizing: border-box; color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 50px;&quot;&gt;&lt;table class=&quot;highlight tab-size js-file-line-container&quot; data-tab-size=&quot;8&quot; style=&quot;border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 14px; tab-size: 8;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC9&quot; style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; overflow-wrap: normal; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre;&quot;&gt;&amp;lt;/&lt;span class=&quot;pl-ent&quot; style=&quot;box-sizing: border-box; color: #22863a;&quot;&gt;Target&lt;/span&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-num js-line-number&quot; data-line-number=&quot;10&quot; id=&quot;L10&quot; style=&quot;box-sizing: border-box; color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 50px;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;background-color: white; color: #24292e; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; white-space: pre;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;pl-ent&quot; style=&quot;background-color: white; box-sizing: border-box; color: #22863a; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; white-space: pre;&quot;&gt;ItemGroup&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #24292e; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; white-space: pre;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;
&lt;table class=&quot;highlight tab-size js-file-line-container&quot; data-tab-size=&quot;8&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 14px; tab-size: 8;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC12&quot; style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; overflow-wrap: normal; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre;&quot;&gt;    &amp;lt;&lt;span class=&quot;pl-ent&quot; style=&quot;box-sizing: border-box; color: #22863a;&quot;&gt;Content&lt;/span&gt; &lt;span class=&quot;pl-e&quot; style=&quot;box-sizing: border-box; color: #6f42c1;&quot;&gt;Include&lt;/span&gt;=&lt;span class=&quot;pl-s&quot; style=&quot;box-sizing: border-box; color: #032f62;&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;node_modules/**&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;pl-e&quot; style=&quot;box-sizing: border-box; color: #6f42c1;&quot;&gt;CopyToPublishDirectory&lt;/span&gt;=&lt;span class=&quot;pl-s&quot; style=&quot;box-sizing: border-box; color: #032f62;&quot;&gt;&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;PreserveNewest&lt;span class=&quot;pl-pds&quot; style=&quot;box-sizing: border-box;&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; /&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-num js-line-number&quot; data-line-number=&quot;13&quot; id=&quot;L13&quot; style=&quot;box-sizing: border-box; color: rgba(27, 31, 35, 0.3); cursor: pointer; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; min-width: 50px; padding: 0px 10px; text-align: right; user-select: none; vertical-align: top; white-space: nowrap; width: 50px;&quot;&gt;&lt;table class=&quot;highlight tab-size js-file-line-container&quot; data-tab-size=&quot;8&quot; style=&quot;border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 14px; tab-size: 8;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC13&quot; style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; overflow-wrap: normal; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre;&quot;&gt;&amp;lt;/&lt;span class=&quot;pl-ent&quot; style=&quot;box-sizing: border-box; color: #22863a;&quot;&gt;ItemGroup&lt;/span&gt;&amp;gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;finally run the publish command &quot;dotnet publish -o c:\temp\publish&quot;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table class=&quot;highlight tab-size js-file-line-container&quot; data-tab-size=&quot;8&quot; style=&quot;background-color: white; border-collapse: collapse; border-spacing: 0px; box-sizing: border-box; color: #24292e; font-family: -apple-system, BlinkMacSystemFont, &amp;quot;Segoe UI&amp;quot;, Helvetica, Arial, sans-serif, &amp;quot;Apple Color Emoji&amp;quot;, &amp;quot;Segoe UI Emoji&amp;quot;; font-size: 14px; tab-size: 8;&quot;&gt;&lt;tbody style=&quot;box-sizing: border-box;&quot;&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;/tr&gt;
&lt;tr style=&quot;box-sizing: border-box;&quot;&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC7&quot; style=&quot;box-sizing: border-box; font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, monospace; font-size: 12px; line-height: 20px; overflow-wrap: normal; overflow: visible; padding: 0px 10px; position: relative; vertical-align: top; white-space: pre;&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/7579463270438073387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2020/01/publishing-nodemodules-in-net-core.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/7579463270438073387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/7579463270438073387'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2020/01/publishing-nodemodules-in-net-core.html' title='Publishing node_modules in .Net Core'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-3511942787762892679</id><published>2013-08-11T10:40:00.001+02:00</published><updated>2013-08-11T10:44:16.879+02:00</updated><title type='text'>How to write Data In XML with some attributes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string dir = HttpContext.Current.Server.MapPath(&quot;~/Errors/&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string FileName = HttpContext.Current.Server.MapPath(&quot;~/Errors/AKAARERRORFILE.xml&quot;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string date = DateTime.Now.Day.ToString() + &quot;-&quot; + DateTime.Now.Month.ToString() + &quot;-&quot; + &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DateTime.Now.Year.ToString();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlTextReader reader = new XmlTextReader(FileName);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlDocument doc = new XmlDocument();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Load(reader);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; reader.Close();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement parentelement = doc.CreateElement(&quot;Date&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlAttribute dateatt=doc.CreateAttribute(&quot;date&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dateatt.Value = date;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parentelement.Attributes.Append(dateatt);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement thepage = doc.CreateElement(&quot;page&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thepage.InnerText = page;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement thefunction = doc.CreateElement(&quot;fun&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thefunction.InnerText = function;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; XmlElement thedes = doc.CreateElement(&quot;des&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; thedes.InnerText = description;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parentelement.AppendChild(thepage);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parentelement.AppendChild(thefunction);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parentelement.AppendChild(thedes);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.DocumentElement.AppendChild(parentelement);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; doc.Save(FileName);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Download&amp;nbsp;&lt;a href=&quot;https://app.box.com/shared/ggbouplfmj&quot;&gt;Example&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/3511942787762892679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/08/how-to-write-data-in-xml-with-some.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/3511942787762892679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/3511942787762892679'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/08/how-to-write-data-in-xml-with-some.html' title='How to write Data In XML with some attributes'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-4418728951809631334</id><published>2013-07-30T13:47:00.002+02:00</published><updated>2013-07-30T13:50:37.753+02:00</updated><title type='text'>How to search using Like for special Character when Database collation is not suitable</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace;&quot;&gt;declare @&lt;/span&gt;nstring nvarchar(20)=null&lt;br /&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;SET @&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; font-size: 13px; line-height: 17px;&quot;&gt;nstring &lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;= N&#39;كرم&#39;;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 17px;&quot;&gt;select * from Customers where Customer_NameA like &#39;%&#39;+@&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; font-size: 13px; line-height: 17px;&quot;&gt;nstring &lt;/span&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;+&#39;%&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Courier, monospace; line-height: 17px;&quot;&gt;reference:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms180059.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/ms180059.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/4418728951809631334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/07/how-to-search-using-like-for-special.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/4418728951809631334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/4418728951809631334'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/07/how-to-search-using-like-for-special.html' title='How to search using Like for special Character when Database collation is not suitable'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-2138269886885088127</id><published>2013-06-17T01:56:00.003+02:00</published><updated>2013-06-18T03:17:56.017+02:00</updated><title type='text'>How to Backup and Restore .bak file using C# 2010</title><content type='html'>references :&lt;br /&gt;
&lt;a href=&quot;http://www.geekpedia.com/tutorial180_Backup-and-restore-SQL-databases.html&quot;&gt;http://www.geekpedia.com/tutorial180_Backup-and-restore-SQL-databases.html&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.codeproject.com/Articles/123441/SQL-Server-2008-Backup-and-Restore-Databases-using&quot;&gt;http://www.codeproject.com/Articles/123441/SQL-Server-2008-Backup-and-Restore-Databases-using&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.c-sharpcorner.com/uploadfile/rohatash/restore-sql-server-backup-file-with-c-sharp/&quot;&gt;http://www.c-sharpcorner.com/uploadfile/rohatash/restore-sql-server-backup-file-with-c-sharp/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://manish4dotnet.blogspot.com/2013/03/RestoreDataBaseusingCSharp.html&quot;&gt;http://manish4dotnet.blogspot.com/2013/03/RestoreDataBaseusingCSharp.html&lt;/a&gt;&lt;br /&gt;
......................................................................................................................................................&lt;br /&gt;
&lt;br /&gt;
//Using namespaces :&lt;br /&gt;
// these namespace found in &quot;c:\Program Files (x86)\Microsoft SQL Server\100\SDK\Assemblies\&quot;&lt;br /&gt;
using Microsoft.SqlServer.Management.Common;&lt;br /&gt;
using Microsoft.SqlServer.Management.Smo;&lt;br /&gt;
using Microsoft.SqlServer.Management.Smo.SqlEnum;&lt;br /&gt;
using System.Collections.Specialized;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ServerConnection srvConn = new ServerConnection(Environment.MachineName);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //my SQL user doesnt have sufficient permissions,&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //so i am using my windows account&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; srvConn.LoginSecure = true;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //connection.LoginSecure = false;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //connection.Login = &quot;testuser&quot;;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //connection.Password = &quot;testuser&quot;;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; public static void RestoreDB(string backUpFilePath, string databaseName)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Restore restore = new Restore();&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Set type of backup to be performed to database&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.Database = databaseName;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.Action = RestoreActionType.Database;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Replace the Db if already exists&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.ReplaceDatabase = true;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Set up the backup device to use filesystem. &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.Devices.AddDevice(backUpFilePath, DeviceType.File);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //set ReplaceDatabase = true to create new database&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //regardless of the existence of specified database&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.ReplaceDatabase = true;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //If you have a differential or log restore to be followed,&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //you would specify NoRecovery = true&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.NoRecovery = false;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Server sqlServer = new Server(srvConn);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //SqlRestore method starts to restore database &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; restore.SqlRestore(sqlServer);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Restore operation succeeded&quot;);&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; catch (Exception ex)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(&quot;Restore operation failed&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(ex.Message);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.ReadLine();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
===============================&lt;br /&gt;
AND to call this Method :&lt;br /&gt;
&lt;br /&gt;
RestoreDB(@&quot;C:\Program Files (x86)\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\SmallStoreme.bak&quot;, &quot;SmallStore&quot;);&lt;br /&gt;
&lt;br /&gt;
===============================&lt;br /&gt;
&amp;nbsp; public static void BackUpDB(string databaseName)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// If there was a SQL connection created&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Create a new backup operation&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Backup bkpDatabase = new Backup();&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Set the backup type to a database backup&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bkpDatabase.Action = BackupActionType.Database;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Set the database that we want to perform a backup on&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bkpDatabase.Database =databaseName;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Set the backup device to a file&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BackupDeviceItem bkpDevice = new BackupDeviceItem(saveBackupDialog.FileName, &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&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;DeviceType.File);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Add the backup device to the backup&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bkpDatabase.Devices.Add(bkpDevice);&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Perform the backup&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bkpDatabase.SqlBackup(srvSql);&lt;/div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
===============================&lt;br /&gt;
AND to call this Method :&lt;br /&gt;
&lt;br /&gt;
BackUpDB(&quot;SmallStore&quot;);&lt;br /&gt;
&lt;br /&gt;
===============================&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/2138269886885088127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/06/how-backup-and-restore-bak-file-using-c.html#comment-form' title='349 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/2138269886885088127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/2138269886885088127'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/06/how-backup-and-restore-bak-file-using-c.html' title='How to Backup and Restore .bak file using C# 2010'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>349</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-5127333817510834520</id><published>2013-06-10T20:35:00.002+02:00</published><updated>2013-06-10T20:35:23.535+02:00</updated><title type='text'>how to truncate table with constraints , make the identity begin with 0 </title><content type='html'>delete from table_name&lt;br /&gt;
&lt;br /&gt;
DBCC CHECKIDENT (table_name, RESEED, 0)</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/5127333817510834520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/06/how-to-truncate-table-with-constraints.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/5127333817510834520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/5127333817510834520'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/06/how-to-truncate-table-with-constraints.html' title='how to truncate table with constraints , make the identity begin with 0 '/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-2018827754757285695</id><published>2013-05-06T17:19:00.003+02:00</published><updated>2013-05-06T17:21:49.767+02:00</updated><title type='text'>Make Combobox in C# Winforms Autocomplete</title><content type='html'>&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt; &amp;nbsp;// This Code is working properly&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Just Copy and paste it&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AutoCompleteStringCollection ac = new AutoCompleteStringCollection();&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (DataRow row in MyDatatable.Rows)&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //looping through the datatable and adding values from datatable into autocomplete collection&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ac.Add(row[&quot;CustName&quot;].ToString());&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comboCustomerName.AutoCompleteSource = AutoCompleteSource.CustomSource; //assigning &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // autocomplete source to the combobox&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; comboCustomerName.AutoCompleteCustomSource = ac;</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/2018827754757285695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/05/make-combobox-in-c-winforms-autocomplete.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/2018827754757285695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/2018827754757285695'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/05/make-combobox-in-c-winforms-autocomplete.html' title='Make Combobox in C# Winforms Autocomplete'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-1566070367335218827</id><published>2013-04-22T02:47:00.004+02:00</published><updated>2013-04-22T02:47:58.839+02:00</updated><title type='text'>How To get The Focused Control</title><content type='html'>&lt;br /&gt;
&lt;h2 style=&quot;background-color: white; color: #044162; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-top: 7px;&quot;&gt;
Import namespaces&lt;/h2&gt;
&lt;br /&gt;
&lt;pre style=&quot;background-color: #dee5ea; border: 1px solid rgb(192, 192, 192); color: #333333; font-size: 12px; line-height: 17px; margin-top: 5px; overflow: auto; padding-bottom: 5px; padding-left: 6px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Runtime.InteropServices;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Windows.Forms;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;background-color: white; color: #044162; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-top: 7px;&quot;&gt;
Win API&lt;/h2&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #dee5ea; border: 1px solid rgb(4, 65, 98); color: #333333; font-size: 12px; line-height: 17px; margin-top: 5px; overflow: auto; padding-bottom: 5px; padding-left: 6px; padding-top: 5px;&quot;&gt;[&lt;span style=&quot;color: #2b91af;&quot;&gt;DllImport&lt;/span&gt;(&lt;span style=&quot;color: maroon;&quot;&gt;&quot;user32.dll&quot;&lt;/span&gt;)]
&lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;extern&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;IntPtr&lt;/span&gt; GetFocus();&lt;/pre&gt;
&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; color: #044162; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 15px; line-height: 17px; margin-bottom: 0px; margin-left: 0px; margin-top: 7px;&quot;&gt;
Use&lt;/h2&gt;
&lt;div&gt;
&lt;pre style=&quot;background-color: #dee5ea; border: 1px solid rgb(4, 65, 98); color: #333333; font-size: 12px; line-height: 17px; margin-top: 5px; overflow: auto; padding-bottom: 5px; padding-left: 6px; padding-top: 5px;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt; focused = &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;
&lt;span style=&quot;color: #2b91af;&quot;&gt;IntPtr&lt;/span&gt; handle = GetFocus();
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (handle != &lt;span style=&quot;color: #2b91af;&quot;&gt;IntPtr&lt;/span&gt;.Zero)
{
    focused = &lt;span style=&quot;color: #2b91af;&quot;&gt;Control&lt;/span&gt;.FromHandle(handle);
}&lt;/pre&gt;
&lt;pre style=&quot;background-color: #dee5ea; border: 1px solid rgb(4, 65, 98); color: #333333; font-size: 12px; line-height: 17px; margin-top: 5px; overflow: auto; padding-bottom: 5px; padding-left: 6px; padding-top: 5px;&quot;&gt;messageBox(focused.Name);&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/1566070367335218827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/04/how-to-get-focused-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/1566070367335218827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/1566070367335218827'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2013/04/how-to-get-focused-control.html' title='How To get The Focused Control'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-2195322564143225014</id><published>2012-07-03T22:09:00.001+02:00</published><updated>2012-07-04T00:50:52.574+02:00</updated><title type='text'>.NET N-Tier Architecture</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div&gt;
1-&lt;span style=&quot;color: #073763;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #eeeeee;&quot;&gt;Business Logic Layer&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #eeeeee;&quot;&gt;&amp;nbsp; &amp;nbsp; it is a class&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;we have table in database called Branch with columns(pk_branch_id,mobile,branch_name,address,notes)&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; so for each column or field we create property to set and get values&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; BusinessLogicLayer
{
    &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Variables

    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; pk_branch_id, mobile;
    &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; branch_name, address, notes;

    &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;

    &lt;span class=&quot;preproc&quot;&gt;#region&lt;/span&gt; Properties

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; Branch_ID
    {
        &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; pk_branch_id; }
        &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; { pk_branch_id = value; }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Branch_Name
    {
        &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; branch_name; }
        &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; { branch_name = value; }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Branch_Address
    {
        &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; address; }
        &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; { address = value; }
    }
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; Branch_Mobile
    {
        &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; mobile; }
        &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; { mobile = value; }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Branch_Notes
    {
        &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; notes; }
        &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; { notes = value; }
    }

    &lt;span class=&quot;preproc&quot;&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
2 - &lt;span style=&quot;color: #cccccc;&quot;&gt;Data Access Layer&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #073763;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt; it is a class&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #073763;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt; which is responsible for creating connection , open, close it,
     create command and execute it

&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; DataAccessLayer
{
    SqlConnection conn;
    SqlCommand cmd;
    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; DataAccessLayer() &lt;span class=&quot;rem&quot;&gt;// Constructor&lt;/span&gt;
    {
conn = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlConnection(ConfigurationManager.ConnectionStrings[&lt;span class=&quot;str&quot;&gt;&quot;ADSL_DBConnectionString&quot;&lt;/span&gt;].ConnectionString);
        conn.Open();
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; Insert_Branch(BusinessLogicLayer bll_branch_INS)
    {
        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(&lt;span class=&quot;str&quot;&gt;&quot;PRC_INSERT_BRANCH&quot;&lt;/span&gt;, conn))
        {
            cmd.CommandType = CommandType.StoredProcedure;
            
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Branch_Name&quot;&lt;/span&gt;, bll_branch_INS.Branch_Name);
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Mobile&quot;&lt;/span&gt;, bll_branch_INS.Branch_Mobile);
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Address&quot;&lt;/span&gt;, bll_branch_INS.Branch_Address);
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Notes&quot;&lt;/span&gt;, bll_branch_INS.Branch_Notes);
            &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; nn = cmd.ExecuteNonQuery();
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (nn &amp;gt; 0)
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
            }
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; Update_Branch( BusinessLogicLayer  bll_branch_UPD)
    {
        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(&lt;span class=&quot;str&quot;&gt;&quot;PRC_UPDATE_BRANCH&quot;&lt;/span&gt;, conn))
        {
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Pk_Branch_Id&quot;&lt;/span&gt;, bll_branch_UPD.Branch_ID);

            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Branch_Name&quot;&lt;/span&gt;, bll_branch_UPD.Branch_Name);
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Mobile&quot;&lt;/span&gt;, bll_branch_UPD.Branch_Mobile);
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Address&quot;&lt;/span&gt;, bll_branch_UPD.Branch_Address);
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Notes&quot;&lt;/span&gt;, bll_branch_UPD.Branch_Notes);
            
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (cmd.ExecuteNonQuery() &amp;gt; 0)
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
            }
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Boolean Delete_Branch(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; id)
    {
        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(&lt;span class=&quot;str&quot;&gt;&quot;PRC_DELETE_BRANCH&quot;&lt;/span&gt;, conn))
        {
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Pk_Branch_Id&quot;&lt;/span&gt;, id);

            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (cmd.ExecuteNonQuery() &amp;gt; 0)
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
            }
            &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt;
            {
                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
            }
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Select_Branch_BYID(&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; id)
    {
        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(&lt;span class=&quot;str&quot;&gt;&quot;PRC_SELECTBRANCH_BYID&quot;&lt;/span&gt;, conn))
        {
            BusinessLogicLayer  bll_branch = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; BusinessLogicLayer();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue(&lt;span class=&quot;str&quot;&gt;&quot;@Pk_Branch_Id&quot;&lt;/span&gt;, id);
            SqlDataReader rdr;
            rdr = cmd.ExecuteReader();
            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (rdr.Read())
            {
            bll_branch.Branch_Name = rdr[&lt;span class=&quot;str&quot;&gt;&quot;Branch_Name&quot;&lt;/span&gt;].ToString();
            bll_branch.Branch_Mobile = Convert.ToInt32(rdr[&lt;span class=&quot;str&quot;&gt;&quot;Mobile&quot;&lt;/span&gt;]);
            bll_branch.Branch_Address = rdr[&lt;span class=&quot;str&quot;&gt;&quot;Address&quot;&lt;/span&gt;].ToString();
            bll_branch.Branch_Notes = rdr[&lt;span class=&quot;str&quot;&gt;&quot;Notes&quot;&lt;/span&gt;].ToString();
            }
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Fill_GridView(GridView GV)
    {
        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(&lt;span class=&quot;str&quot;&gt;&quot;PRC_FILL_GV&quot;&lt;/span&gt;, conn))
        {
            cmd.CommandType = CommandType.StoredProcedure;
            DataTable dt = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; DataTable();
            SqlDataAdapter adpr = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlDataAdapter(cmd);
            adpr.Fill(dt);
            GV.DataSource = dt;
            GV.DataBind();
        }
    }

    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Fill_DropDownList(DropDownList DDL, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; datatext, &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; datavalue)
    {
        &lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; (cmd = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SqlCommand(&lt;span class=&quot;str&quot;&gt;&quot;PRC_FILL_DDR&quot;&lt;/span&gt;, conn))
        {
            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataReader rdr;
            rdr = cmd.ExecuteReader();
            DDL.DataSource = rdr;
            DDL.DataTextField = datatext;
            DDL.DataValueField = datavalue;
            DDL.DataBind();
        }
    }

}
&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/2195322564143225014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2012/07/net-n-tier-architecture.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/2195322564143225014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/2195322564143225014'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2012/07/net-n-tier-architecture.html' title='.NET N-Tier Architecture'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-6389561828480531507</id><published>2012-07-03T09:09:00.000+02:00</published><updated>2012-07-03T10:37:48.607+02:00</updated><title type='text'>- MultiView</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3&gt;




Multi View (Source Code ASP.NET)&lt;/h3&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:MultiView&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;MultiView1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ActiveViewIndex&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:View&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;View1&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblNameINS&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;User Name &quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtNameINS&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblAddINS&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;User Address &quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtAddINS&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;300&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblAgeINS&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;User Age &quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtAgeINS&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:LinkButton&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lnkbtnINS&quot;&lt;/span&gt; 
                            &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Go to Update&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;onclick&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lnkbtn_Click&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:LinkButton&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:View&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:View&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;View2&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblNameUPD&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;User Name U&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtNameUPD&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblAddUPD&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;User Address U&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtAddUPD&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;300&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;center&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lblAgeUPD&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;User Age U&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:Label&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;txtAgeUPD&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;Width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;100&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:TextBox&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;200&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;align&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;right&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:LinkButton&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;runat&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;ID&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lnkbtnUPD&quot;&lt;/span&gt; 
                            &lt;span class=&quot;attr&quot;&gt;Text&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;Go to Insert&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;onclick&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;lnkbtnUPD_Click&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:LinkButton&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;td&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                
                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;tr&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
                
            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;table&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:View&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;
     
    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;asp:MultiView&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt; &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; lnkbtn_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 1;
    }
    &lt;span class=&quot;kwrd&quot;&gt;protected&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; lnkbtnUPD_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 0;
    }&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/6389561828480531507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2012/07/multi-view-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/6389561828480531507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/6389561828480531507'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2012/07/multi-view-example.html' title='- MultiView'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-610357705230754183.post-1119443886037555937</id><published>2012-07-01T09:12:00.002+02:00</published><updated>2012-07-03T22:10:08.065+02:00</updated><title type='text'>- SQL</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3&gt;








&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
 background-color: #f4f4f4;
 width: 100%;
 margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;MAX&lt;/span&gt; (stdDegree)&lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; dbo.STD &lt;span class=&quot;kwrd&quot;&gt;WHERE&lt;/span&gt; stdDegree &lt;span class=&quot;kwrd&quot;&gt;IN&lt;/span&gt;
(&lt;span class=&quot;kwrd&quot;&gt;SELECT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;DISTINCT&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;TOP&lt;/span&gt; 2 stdDegree &lt;span class=&quot;kwrd&quot;&gt;FROM&lt;/span&gt; dbo.STD 
&lt;span class=&quot;kwrd&quot;&gt;ORDER&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;BY&lt;/span&gt; stdDegree &lt;span class=&quot;kwrd&quot;&gt;DESC&lt;/span&gt;)&lt;/pre&gt;
&lt;/h3&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-sharp-tricks.blogspot.com/feeds/1119443886037555937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-sharp-tricks.blogspot.com/2012/07/select-second-max-degree-in-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/1119443886037555937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/610357705230754183/posts/default/1119443886037555937'/><link rel='alternate' type='text/html' href='http://c-sharp-tricks.blogspot.com/2012/07/select-second-max-degree-in-table.html' title='- SQL'/><author><name>Weshahi</name><uri>http://www.blogger.com/profile/06542207940776895536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='28' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8iBEPo8NHVgeSXVbAqeI-6hUimwccqNEGM9pHtaNkfx_nuIMF-lGAtg6NO5kzscuqSDPMDGMKik4nnKGjKyUYwBivqW3Ryg19wqkCcod5T-pHZS1jM1oRzaNbgs389w/s127/Annotation+2020-01-02+140707.png'/></author><thr:total>0</thr:total></entry></feed>