<?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-8327079126128012656</id><updated>2024-10-05T08:31:25.820+05:30</updated><category term="asp.net provider"/><category term=".NET Framework"/><category term=".NET Framework Basics"/><category term=".net class library"/><category term="ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)"/><category term="Aspnet_regsql"/><category term="Aspnet_regsql.exe"/><category term="C# basics"/><category term="C# oops"/><category term="Difference between for loop and foreach loop"/><category term="Difference of for loop and foreach loop"/><category term="LINQ Delete Query"/><category term="LINQ Insert Query"/><category term="LINQ SQL"/><category term="LINQ Select Query"/><category term="LINQ Update Query"/><category term="LINQ to SQL"/><category term="Language integrated Query"/><category term="Linq"/><category term="Linq query"/><category term="Oops Concept in C#"/><category term="SQL QUERY Library Management System"/><category term="SQL library management"/><category term="SQL membership"/><category term="Save Image into SQL Server via VB.net"/><category term="asp.net sql server configuration"/><category term="class library"/><category term="clr"/><category term="common language runtime"/><category term="database exploration in c# &amp; sql server"/><category term="database exploration using c# &amp; sql server"/><category term="database exploration with c# &amp; sql server"/><category term="database explorer"/><category term="db explorer"/><category term="difference of .net framework"/><category term="different version of framework"/><category term="for loop vs foreach loop"/><category term="library management sql query"/><category term="linq DML query"/><category term="membership provider configuration"/><category term="sql role provider"/><category term="store image into database using vb.net"/><category term="store picture into database"/><title type='text'>Share Programming Ideas</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></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-8327079126128012656.post-1407567349860897543</id><published>2013-07-11T11:03:00.001+05:30</published><updated>2013-07-11T11:38:20.849+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Difference between for loop and foreach loop"/><category scheme="http://www.blogger.com/atom/ns#" term="Difference of for loop and foreach loop"/><category scheme="http://www.blogger.com/atom/ns#" term="for loop vs foreach loop"/><title type='text'>Difference Between For loop and For each loop</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;display: block; margin-top: 20px; width: 600px;&quot;&gt;
&lt;strong&gt;For Loop:&lt;/strong&gt;&lt;br /&gt;
&lt;div align=&quot;justify&quot; style=&quot;text-indent: 40px;&quot;&gt;
It’s preferred when you know how many iteration you want. It is used to executes a block of statements for as long as a specified condition is true.&lt;/div&gt;&lt;br /&gt;
&lt;u&gt;General Syntax:&lt;/u&gt; &lt;br /&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; height: 106px; padding-left: 10px; padding-top: 10px; width: 317px;&quot;&gt;
for(Initialization; Test Condition; Increment)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Statement;&lt;br /&gt;
}&lt;/div&gt;
&lt;div align=&quot;justify&quot; style=&quot;margin-top:10px&quot;&gt;
&lt;strong&gt;Example:&lt;/strong&gt; To add the number from 1 to 10 by using for loop and sum the number by series of 1+2+3+...+10.&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; margin-top: 20px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; padding-top: 10px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Collections.Generic; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Text; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; for_loop &lt;br /&gt;
{ &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;Program&lt;/span&gt; &lt;br /&gt;
{ &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;static void&lt;/span&gt; Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;[] arry = &lt;span style=&quot;color: blue;&quot;&gt;new int&lt;/span&gt;[] {1,2,3,4,5,6,7,8,9,10 };&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; s = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; arry.Length; i++) &lt;br /&gt;
&amp;nbsp;&amp;nbsp; { &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s = s+ arry[i]; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #4bacc6;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Sum is: {0}&quot;&lt;/span&gt;,s);&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #4bacc6;&quot;&gt;Console&lt;/span&gt;.ReadKey();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; margin-top: 20px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; padding-top: 10px;&quot;&gt;
&lt;strong&gt;Output : &lt;/strong&gt;Sum is:55&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;For Each Loop:&lt;/strong&gt;&lt;br /&gt;
&lt;div align=&quot;justify&quot; style=&quot;text-indent: 40px;&quot;&gt;
It operates on collections of items, for instance arrays or other built-in list types. It does not use an integer index. Instead, it is used on a collection and returns each element in order. In the foreach-statement, you do not need to specify the loop bounds minimum or maximum. It traverse whole collection.&lt;/div&gt;&lt;br /&gt;
&lt;u&gt;General Syntax:&lt;/u&gt; &lt;br /&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; height: 109px; padding-left: 10px; padding-top: 10px; width: 247px;&quot;&gt;
foreach( Datatype item in items )&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Statement;&lt;br /&gt;
}&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;Example:&lt;/strong&gt; To add the number from 1 to 10 by using foreach loop and sum the number by series of 1+2+3+...+10.&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; margin-top: 20px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; padding-top: 10px;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Collections.Generic; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Text; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; for_loop &lt;br /&gt;
{ &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;Program&lt;/span&gt; &lt;br /&gt;
{ &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;static void&lt;/span&gt; Main(&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[] args)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;[] arry = &lt;span style=&quot;color: blue;&quot;&gt;new int&lt;/span&gt;[] {1,2,3,4,5,6,7,8,9,10 };&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; s = 0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; arry) &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;&amp;nbsp; s = s+ i; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #4bacc6;&quot;&gt;Console&lt;/span&gt;.WriteLine(&lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Sum is: {0}&quot;&lt;/span&gt;,s);&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #4bacc6;&quot;&gt;Console&lt;/span&gt;.ReadKey();&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; margin-top: 20px; padding-bottom: 10px; padding-left: 20px; padding-right: 10px; padding-top: 10px;&quot;&gt;
&lt;strong&gt;Output : &lt;/strong&gt;Sum is:55&lt;/div&gt;
&lt;strong&gt;Conclusion:&lt;/strong&gt; &lt;br /&gt;
&lt;div style=&quot;margin-top: 15px;&quot;&gt;
&lt;div align=&quot;justify&quot; style=&quot;text-indent: 40px;&quot;&gt;
Both the concepts are same only. &lt;strong&gt;For each&lt;/strong&gt; is used for traversing items in a collection. It usually maintain no explicit counter and no use of index. They essentially say &quot;do this to everything in this set&quot;, rather than &quot;do this x times&quot;.&lt;/div&gt;
&lt;div align=&quot;justify&quot; style=&quot;text-indent: 40px; margin-top:10px&quot;&gt;
&lt;strong&gt;For loop&lt;/strong&gt; is classified as an iteration statement. The statements in the for loop repeat continuously for a specific number of times. It as counter and integer index (ex: a[i], i represent the index value and change it by increment operation on each iteration).&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/1407567349860897543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/07/difference-between-for-loop-and-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1407567349860897543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1407567349860897543'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/07/difference-between-for-loop-and-for.html' title='Difference Between For loop and For each loop'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-6523676230426934957</id><published>2013-07-10T23:14:00.001+05:30</published><updated>2013-07-10T23:29:03.649+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="LINQ Delete Query"/><category scheme="http://www.blogger.com/atom/ns#" term="linq DML query"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ Insert Query"/><category scheme="http://www.blogger.com/atom/ns#" term="Linq query"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ Select Query"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ Update Query"/><title type='text'>LINQ with DML Queries</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;display: block; margin-top: 15px; width: 600px;&quot;&gt;
This Post is a continuation of &lt;a href=&quot;http://www.programtechn.blogspot.in/2013/07/linqlanguage-integrated-query.html&quot; target=&quot;_blank&quot;&gt;LINQ&lt;/a&gt;.&lt;br /&gt;
Here the following concepts are explain about LINQ with DML Queries. &lt;br /&gt;
&lt;div style=&quot;display: block; margin-top: 5px;&quot;&gt;
&lt;span style=&quot;color: lime;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: black;&quot;&gt;DML&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
Data Manipulation Language (DML) statements are used for managing data within schema objects. They are:  &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Select  &lt;/li&gt;
&lt;li&gt;Insert  &lt;/li&gt;
&lt;li&gt;Update  &lt;/li&gt;
&lt;li&gt;Delete &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;display: block; margin-top: 20px;&quot;&gt;
&lt;h3&gt;
Select&lt;/h3&gt;
&lt;div align=&quot;justify&quot; style=&quot;display: block; text-indent: 40px;&quot;&gt;
The SELECT statement returns a result set of records from one or more tables. The SELECT statement has many optional clauses: WHERE, ORDER BY, GROUP BY&lt;/div&gt;
For Example:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A Table name as &lt;span style=&quot;color: #c0504d;&quot;&gt;tbl_Student&lt;/span&gt;.  &lt;/li&gt;
&lt;li&gt;This table contain the following columns: &lt;span style=&quot;color: #c0504d;&quot;&gt;StudentID, Firstname, Lastname, Location, Email&lt;/span&gt;. &lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #fcfcfc; padding-bottom: 10px; padding-left: 20px; padding-top: 10px;&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #9e7c7c;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;LINQ SELECT Statement with WHERE Clause&lt;/span&gt;:&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;display: block; margin-top: 10px; padding-left: 50px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt; db = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; student = &lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&lt;/span&gt; stud &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; db.tbl_Students&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where&lt;/span&gt; db.Location == &lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Pondy&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/span&gt; stud;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; padding-bottom: 10px; padding-left: 20px; padding-top: 0px;&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #9e7c7c;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;LINQ SELECT Statement with ORDER BY&lt;/span&gt;:&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;display: block; margin-top: 10px; padding-left: 50px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt; db = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; student = &lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&lt;/span&gt; stud &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; db.tbl_Students&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;orderby&lt;/span&gt; stud.Location&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select&lt;/span&gt; stud;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; padding-bottom: 10px; padding-left: 20px; padding-top: 0px;&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #9e7c7c;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;LINQ SELECT Statement with GROUP BY&lt;/span&gt;:&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;display: block; margin-top: 10px; padding-left: 50px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt; db = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; student = &lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group&lt;/span&gt; s &lt;span style=&quot;color: blue;&quot;&gt;by&lt;/span&gt; s.tbl_Students &lt;span style=&quot;color: blue;&quot;&gt;into&lt;/span&gt; g&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; g.count() &amp;gt;= 1&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select new&lt;/span&gt;&lt;br /&gt;&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; g.Key,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LocationCount = g.Count()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;display: block; margin-top: 20px;&quot;&gt;
&lt;h3&gt;
Insert&lt;/h3&gt;
&lt;div align=&quot;justify&quot; style=&quot;display: block; text-indent: 40px;&quot;&gt;
To execute a SQL Insert, just add objects to the object model you have created, and call SubmitChanges on the DataContext.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The following example, Let insert&amp;nbsp; a new Student detail into tbl_Student table. This table contain the following columns: StudentID, Firstname, Lastname, Location &amp;amp; Email.&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; padding-bottom: 10px; padding-left: 20px; padding-top: 10px;&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #9e7c7c;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;LINQ INSERT Statement&lt;/span&gt;:&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;display: block; margin-top: 10px; padding-left: 50px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt; db = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;tbl_Student&lt;/span&gt; ts = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;tbl_Student&lt;/span&gt;();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.StudentID = textBox1.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Firstname = textBox2.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Lastname = textBox3.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Location = textBox4.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts.Email = textBox5.Text;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db.tbl_Students.InsertOnSubmit(ts);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db.SubmitChanges();&lt;br /&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;MessageBox.Show&lt;/span&gt;(&lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Value inserted Successfully&quot;&lt;/span&gt;); &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;display: block; margin-top: 20px;&quot;&gt;
&lt;h3&gt;
Update&lt;/h3&gt;
&lt;div align=&quot;justify&quot; style=&quot;display: block; text-indent: 40px;&quot;&gt;
To Update a database entry, first retrieve the item and edit it directly in the object model. After you have modified the object, call SubmitChanges on the DataContext to update the database.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The following example, Let retrieve a Student detail from &lt;span style=&quot;color: #c0504d;&quot;&gt;tbl_Student&lt;/span&gt; table who are all from Location Pondy. Then change &lt;span style=&quot;color: #c0504d;&quot;&gt;Location&lt;/span&gt; = &lt;span style=&quot;color: #c0504d;&quot;&gt;“Pondy”&lt;/span&gt; to &lt;span style=&quot;color: #c0504d;&quot;&gt;“Puducherry”&lt;/span&gt;. Finally SubmitChanges is called to send the changes to database.&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; padding-bottom: 10px; padding-left: 20px; padding-top: 10px;&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #9e7c7c;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;LINQ UPDATE Statement&lt;/span&gt;:&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;display: block; margin-top: 10px; padding-left: 50px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt; db = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;var &lt;/span&gt;Loc = &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; s in db.tbl_Student&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; Loc.Location.Contains(&lt;span style=&quot;color: #c0504d;&quot;&gt;”Pondy”&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; Loc;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;foreach&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;var&lt;/span&gt; student &lt;span style=&quot;color: blue;&quot;&gt;in&lt;/span&gt; Loc)&lt;br /&gt;{&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (student.Location == &lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Pondy&quot;&lt;/span&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; student.Location = &lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Puducherry&quot;&lt;/span&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;db.SubmitChanges();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;display: block; margin-top: 20px;&quot;&gt;
&lt;h3&gt;
Delete&lt;/h3&gt;
&lt;div align=&quot;justify&quot; style=&quot;display: block; text-indent: 40px;&quot;&gt;
To Delete an item, remove the item from the collection to which it belongs, and then call SubmitChanges on the DataContext to commit the change.&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
The following example, delete a Student detail from tbl_Student table who are all from Location &#39;Chennai&#39;. Finally SubmitChanges is called to send the changes to database.&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; display: block; padding-bottom: 10px; padding-left: 20px; padding-top: 10px;&quot;&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #9e7c7c;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;LINQ DELETE Statement&lt;/span&gt;:&lt;/span&gt;&lt;/h2&gt;
&lt;div style=&quot;margin-top: 10px; padding-left: 50px;&quot;&gt;
&lt;span style=&quot;font-family: Verdana;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt; db = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6;&quot;&gt;DataClasses1DataContext&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;()&lt;/span&gt;; &lt;br /&gt;&lt;span style=&quot;color: #4bacc6;&quot;&gt;var &lt;/span&gt;delLoc = &lt;span style=&quot;color: blue;&quot;&gt;from&lt;/span&gt; s in db.tbl_Student&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;where&lt;/span&gt; s.Location == &lt;span style=&quot;color: #c0504d;&quot;&gt;&quot;Chennai&quot;&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;select&lt;/span&gt; s;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (delLoc.Count() &amp;gt; 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db.tbl_Student.DeleteOnSubmit(delLoc.First());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db.SubmitChanges();&lt;br /&gt;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/6523676230426934957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/07/linq-with-dml-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/6523676230426934957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/6523676230426934957'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/07/linq-with-dml-queries.html' title='LINQ with DML Queries'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-1016713205751647754</id><published>2013-07-09T22:40:00.001+05:30</published><updated>2013-07-10T11:25:32.049+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Language integrated Query"/><category scheme="http://www.blogger.com/atom/ns#" term="Linq"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ to SQL"/><title type='text'>LINQ–Language Integrated Query</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;margin: 20px 0px 0px;&quot;&gt;
&lt;div align=&quot;justify&quot; style=&quot;text-indent: 40px;&quot;&gt;
Language-Integrated Query (LINQ) is a set of features introduced in Visual Studio 2008 that extends powerful query capabilities to the language syntax of C# and Visual Basic. LINQ introduces standard, easily-learned patterns for querying and updating data, and the technology can be extended to support potentially any kind of data store. Visual Studio includes LINQ provider assemblies that enable the use of LINQ with .NET Framework collections, SQL Server databases, ADO.NET Datasets, and XML documents.&lt;/div&gt;
&lt;div style=&quot;margin: 20px 0px 0px;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0PHP2p2lLX_caCn6atCwW-o4o2ACI2uyipBmtlBngS_tAFF26rgaDlc3fEvjh98Er-Hp48gIbZqef_GuzZlz3dRPdGqOuhCuDcW-PmFc3FMlH1DkMaffiGK5ywxuLPOzWpO31IEi-MfZg/s1600-h/UnderstandingLINQ14.jpg&quot;&gt;&lt;img alt=&quot;UnderstandingLINQ&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiMMrj7Q5Vi4XDuRwc7AtIA7tIgwqunvyLNl_MtDq_hzzV1pT3x5vYdMz9PUuhoU6R3wMz2sk0FAWqZWM1j-oq2MBVV3592X6p1NbFLaEnazFaf1A9LYiijfIr1nJ3Wa5Sw36LkfRtYooI/?imgmax=800&quot; height=&quot;394&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;LINQ Architecture&quot; width=&quot;590&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;LINQ Providers:  &lt;/b&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;LINQ to SQL  &lt;/li&gt;
&lt;li&gt;LINQ to XML  &lt;/li&gt;
&lt;li&gt;LINQ to Dataset  &lt;/li&gt;
&lt;li&gt;LINQ to Objects &lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;margin: 20px 0px 0px;&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;LINQ to SQL:&lt;/span&gt;&lt;/strong&gt;  &lt;br /&gt;
&lt;div align=&quot;justify&quot; style=&quot;margin-top: 10px; text-indent: 40px;&quot;&gt;
LINQ to SQL is a component of .NET Framework version 3.5 that provides a run-time infrastructure for managing relational data as objects. In LINQ to SQL, the data model of a relational database is mapped to an object model expressed in the programming language of the developer. When the application runs, LINQ to SQL translates into SQL the language-integrated queries in the object model and sends them to the database for execution. When the database returns the results, LINQ to SQL translates them back to objects that you can work with in your own programming language.&lt;/div&gt;
&lt;div align=&quot;justify&quot; style=&quot;text-indent: 40px;&quot;&gt;
By using LINQ to SQL, you can use the LINQ technology to access SQL databases just as you would access an in-memory collection.&lt;/div&gt;
&lt;div style=&quot;margin-top: 10px;&quot;&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 1: The Below picture will explain how to add LINQ to SQL in your project&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;Open Visual Studio and goto New Project and select the Windows Form Application.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;In Solution Explorer, right click the application name -&amp;gt; Add -&amp;gt; New item.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZn1LfxrBIq9tacSE9azsMVr2Vxq8Wm9zBfB-wuVBGeOeAZyGX0acojDdrbC0f-UqckHRkn5hEONcy81iscKDmyGfHz7AiIvwN9_dot32anIIVxDe16ruk0785AI7WCykHKTgcg5_jRNv9/s1600-h/1%25255B4%25255D.jpg&quot;&gt;&lt;img alt=&quot;1&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPmrlEwpEDugP_jMv-z9cIsKnQi187ktifxXuvZPcidSY9877OFaZGcJIfx8pDCJSne1b2_rNAwy1dAdwztW6ZrI97xdhWG-05pD6FruwCoNbJNcbx5J0IXvFrzGIIfaGxXXH55YbfXfZX/?imgmax=800&quot; height=&quot;303&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;LINQ to SQL &quot; width=&quot;539&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 2: After open the &quot;Add New Item Wizard&quot; select the LINQ to SQL classes file in Data Category.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTsnUIqR6BP-NbpEHpZcx0HX5LvgS0jw5c0lBI7_McrP8n6-zXA2JeEi3X-QVL-DZ5207bYn28eVxoWNXO-isOFL5Hp3SGV9QDcuMiLD00HKuqsyRhHHbhiBELS2_S_0f3VeOjTCL14u6m/s1600-h/2%25255B4%25255D.jpg&quot;&gt;&lt;img alt=&quot;2&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid_UwKFz0cN6TCAeuoo05otlkH0uP_vX37BonFDJ5Ty7lCjKVA-tL36XDy0NDiH97J15meMPelCf90XCddnG0A9fl6e5lAfiRpSw2jXW21cuXyoeTQrua5alSyz-PyuVCVESJVquYoNNND/?imgmax=800&quot; height=&quot;303&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Add New Item wizard for LINQ to SQL Class file&quot; width=&quot;539&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 3: The Object Relational Designer allows you to visualize data classes in your code. By click Server Explorer to add the table.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjFkcT4jbrQQ0baQb3HtnbylRx_3-7YNekb_CAimog3adlTBmhtRZWXzrweGXCkcxcRbr7n0Oef39ABOLb5D_ljrow2GBQ31jPIrPhqEl8gAt-cWSxc8HnqSs6wGRMgG_m0DBrb7d5aM9r/s1600-h/3%25255B4%25255D.jpg&quot;&gt;&lt;img alt=&quot;3&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoiKlMf5ZtdNxI_1poVKhvKXAU9OsyRbPgUN_XNh5VP2NJ5iZzk55clY6gQBQM6ydfhtF5aToiWn6-W2c_yOLfD1ec2kRm3fDvRyR4o0-dHYawv9iRNfvQfhTQ2hF8ygT6-WoLyy1zVUK1/?imgmax=800&quot; height=&quot;305&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Server Explore&quot; width=&quot;542&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 4: Connect Database using Server Explorer at Right side or click the link enable text.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDGYf4uWWQFRzSkU5ygjdDon9In4Os3bRlvSyFVaRhzxZ4g-JIENsjgWbpqmfW6ODox8O6LZPM7Wcoy-AetByN7b0XvFFJWjmwObGwHfPPDenQtnVriE33OOC1zZm4KXioy5uodUWCBp7T/s1600-h/4%25255B2%25255D.jpg&quot;&gt;&lt;img alt=&quot;4&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB_rEyFThbxjJOK8vt0kadCQsMgo3hHH0tqYiPlQzkSk59TWeCppqqkqmvKOWsT2tTBj4hpA606K5ij4mhVZrdHP0njuR_9hcwmTkue1gac3FOW4DWNU7q6Y8NMrZZ0rUSduiWlaQpNk6e/?imgmax=800&quot; height=&quot;244&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Server Explorer for Connect to Database&quot; width=&quot;194&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 5: Connect to Database using Server Explorer.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9g4SAA7Xhwee1nBifBguTNqWSRFnvLF2Mxpy77s_ZMZ50K1f-bBYzr5ljM67UwElU1H1t5pNVOpcEhsnwXkWAbYjxhDBv1T2wm_WcoaiyAG4imNKlz63_tsJylelBPQ8tfVLyel-EuyFo/s1600-h/5%25255B6%25255D.jpg&quot;&gt;&lt;img alt=&quot;5&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ1AXaxVNlwP-bilSOtc1Jf1Yu9pWM9V36ZNcuWuVoleZIyk4BMSVWJFsppRlub2u7DxUaebzLpAJWIOqZ_X4M4fat08g3Mc24-rKFlgNTLac6HRpX5Zi6D2u-UR2AvxyOHYFfHutWAubV/?imgmax=800&quot; height=&quot;309&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Add Connection to database&quot; width=&quot;214&quot; /&gt;&lt;/a&gt; &lt;/td&gt; &lt;td style=&quot;background-color: #fcfcfc; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px; vertical-align: top;&quot;&gt;1.Default DataSource is SQL Server(Sqlclient). &lt;br /&gt;
&lt;br /&gt;
2.Type the server name.&lt;br /&gt;
&lt;br /&gt;
3.Select authentication type based on sql server &lt;br /&gt;
&lt;br /&gt;
4.Select the Database.&lt;br /&gt;
&lt;br /&gt;
5.(Optional) Verify the connection using Test Connection.&lt;br /&gt;
&lt;br /&gt;
6.Press OK to make a connection with database and our project. &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 6: Drag the table from server explorer to Dataclasses file.&lt;/span&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxPzuhNMWL48_u4-fkpkPDRyMRx-b_pqAqo9UboIQIREqw3-vd1nOhuF3QhrSTm6a2VIz3Y-BGb-Wcq-x8W5CyQCup9bk5R7g3qm8B8k8S2lp9OQXJXLU-0xxVAcPDKB1XsoISlJ7NreZ_/s1600-h/7%25255B7%25255D.jpg&quot;&gt;&lt;img alt=&quot;7&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBtewzfqELq9GqIxbMZ5UHuzUoybnp_lrH1OlThgz4jDyh_X42_CaPPwfcHdCqjcTiRqsWR9I1giQ6jbGSZPKNjgZdFzNIZTQxd2k6wc9a6gD9_ZPxGWcJQz7UecfqQJv9_uiP8Hntsms/?imgmax=800&quot; height=&quot;305&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;After Connection Establish &amp;amp; DataClasses&quot; width=&quot;542&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #4bacc6; color: white;&quot;&gt;Step 7: Double click the Form in solution explorer and place a Datagridview control from Toolbox to form. Write the below code in Form Load event.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-top: 10px;&quot;&gt;
&lt;span style=&quot;background-color: #d9ead3;&quot;&gt;&lt;b&gt;&lt;u&gt;LINQ with SELECT&amp;nbsp;&lt;/u&gt;&lt;/b&gt;&lt;b&gt;&lt;u&gt;Statement and without Where Clause&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
namespace linq_example&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public partial class Form1 : Form&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Form1()&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Form1_Load(object sender, EventArgs e)&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&lt;span style=&quot;color: #c81414;&quot;&gt;//Create DataContext object by using LINQ file DataClasses.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DataClasses1DataContext db = new DataClasses1DataContext();  &lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&lt;span style=&quot;color: #c81414;&quot;&gt;//Linq query using IQueryable for Select statement query.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&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; IQueryable&amp;lt;tbl_Student&amp;gt; student =&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&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;&amp;nbsp; from stud in db.tbl_Students&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&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;&amp;nbsp; select stud;&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&lt;span style=&quot;color: #c81414;&quot;&gt;//set Datasource to DataGridView for bind the data.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataGridView1.DataSource = student;&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: #d5a6bd; color: white;&quot;&gt;The Above code used the concept of linq to sql with Select statment and bind the data into datagridview.&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-color: #fcfcfc;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;margin:10px 0px 10px 0px&quot;&gt;OUTPUT:&lt;/div&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEuW2YigrOo_piAWdTS7IURARnTP0Pz-mioB6Td70Q7euOicw3lieROx6jNbYgrFum1JDp87k4SxhzySlo3gfgu_pO8-RB7mD0QQrBLBwnktzLDmcyygSfUwtKGr9rnJYCWBv3l5paUZ9G/s1600-h/output%25255B4%25255D.jpg&quot;&gt;&lt;img alt=&quot;output&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgg-76QgJe1Lrq_2W44Vcjl85qiR-K2JYCjq0GndjQzPjXd8Zq9uNnfvNlo9VsLw33ttsZKCVJ6_6v9TKaU5rhAfPj34g6K52S5-RY4Str7Xwl7Gij9_R6ChBv0bkQ99r1lrEnEjQuLPQ6X/?imgmax=800&quot; height=&quot;303&quot; style=&quot;background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;output&quot; width=&quot;539&quot; /&gt;&lt;/a&gt;  &lt;/div&gt;
&lt;div style=&quot;background-color: #fcfcfc; margin: 20px 0px 0px; padding-bottom: 10px; padding-left: 10px; padding-right: 10px; padding-top: 10px;&quot;&gt;
For Download Source Code: &lt;a href=&quot;https://docs.google.com/file/d/0BwjszzqlLXFBenY4Q0VvS2JtTWc/edit?usp=drive_web&amp;amp;pli=1&quot;&gt;Click Here&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/1016713205751647754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/07/linqlanguage-integrated-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1016713205751647754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1016713205751647754'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/07/linqlanguage-integrated-query.html' title='LINQ–Language Integrated Query'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiMMrj7Q5Vi4XDuRwc7AtIA7tIgwqunvyLNl_MtDq_hzzV1pT3x5vYdMz9PUuhoU6R3wMz2sk0FAWqZWM1j-oq2MBVV3592X6p1NbFLaEnazFaf1A9LYiijfIr1nJ3Wa5Sw36LkfRtYooI/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-324761053005048470</id><published>2013-07-08T23:27:00.001+05:30</published><updated>2013-07-08T23:32:09.682+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net provider"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL membership"/><category scheme="http://www.blogger.com/atom/ns#" term="sql role provider"/><title type='text'>ASP.NET 4.0 Providers</title><content type='html'>&lt;div style=&quot;margin: 20px 0px 0px&quot;&gt; &lt;p style=&quot;text-indent: 40px&quot; align=&quot;justify&quot;&gt;Several ASP.NET application services rely on a provider to manage storing and retrieving data from a data source. Each provider is specific to the data source. ASP.NET includes a SQL Server provider for the following ASP.NET features:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Membership (the SqlMembershipProvider class).  &lt;li&gt;Role management (the SqlRoleProvider class).  &lt;li&gt;Profile (the SqlProfileProvider class).  &lt;li&gt;Web Parts personalization (the SqlPersonalizationProvider class).  &lt;li&gt;Web events (the SqlWebEventProvider class).&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The above features are we need to define in asp.net &#39;Web.config&#39; file.&lt;/p&gt; &lt;p style=&quot;text-indent: 40px&quot; align=&quot;justify&quot;&gt;Web.config is the main settings and configuration file for an ASP.NET web application. The file is an XML document that defines configuration information regarding the web application.This file stores the information about how the web application will act. The web.config file contains information that controls module loading, security configuration, session state configuration, and application language and compilation settings. Web.config files can also contain application specific items such as database connection strings.&lt;/p&gt; &lt;div style=&quot;background-color: #c6e6f5&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot;?&amp;gt;&lt;br&gt;&amp;lt;configuration&amp;gt;&lt;br&gt;&amp;lt;connectionstrings&amp;gt;&lt;br&gt;&amp;lt;add name=&quot;ApplicationServices&quot;&lt;br&gt;connectionstring=&quot;data source=localhost;Integrated Security=True;Initial Catalog=aspnetdb&quot; providername=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;br&gt;&amp;lt;/connectionstrings&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;system.web&amp;gt;&lt;br&gt;&amp;lt;compilation debug=&quot;false&quot; targetframework=&quot;4.0&quot; /&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;authentication mode=&quot;[Windows|Forms|Passport|None]&quot;&amp;gt;&lt;br&gt;&amp;lt;/authentication&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;membership defaultprovider=&quot;name of membership provider what you&#39;ve created.&quot;&amp;gt;&lt;br&gt;&amp;lt;providers&amp;gt;&quot;part for membership provider properties.&quot; &amp;lt;/providers&amp;gt;&lt;br&gt;&amp;lt;/membership&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;profile&amp;gt;&lt;br&gt;&amp;lt;providers&amp;gt;&quot;part for profile provider properties.&quot; &amp;lt;/providers&amp;gt;&lt;br&gt;&amp;lt;/profile&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;rolemanager enabled=&quot;false&quot;&amp;gt;&lt;br&gt;&amp;lt;providers&amp;gt;&quot;part for role provider properties.&quot; &amp;lt;/providers&amp;gt;&lt;br&gt;&amp;lt;/rolemanager&amp;gt;&lt;br&gt;&amp;lt;/system.web&amp;gt;&lt;br&gt;&lt;br&gt;&amp;lt;system.webserver&amp;gt;&lt;br&gt;&amp;lt;modules runallmanagedmodulesforallrequests=&quot;true&quot; /&amp;gt;&lt;br&gt;&amp;lt;/system.webserver&amp;gt;&lt;br&gt;&amp;lt;/configuration&amp;gt;&lt;br&gt;&lt;/div&gt; &lt;div style=&quot;margin: 20px 0px 0px&quot;&gt; &lt;p&gt;&lt;strong&gt;&lt;font style=&quot;background-color: #4bacc6&quot; color=&quot;#ffffff&quot;&gt;Configuring SQL Server Provider by Web.config file.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;font color=&quot;#c0504d&quot;&gt;SQL Membership Provider:&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;text-indent: 40px&quot; align=&quot;justify&quot;&gt;ASP.NET membership gives you a built-in way to validate and store user credentials. ASP.NET membership therefore helps you manage user authentication in your Web sites. You can use ASP.NET membership with ASP.NET forms authentication by using with the ASP.NET login controls to create a complete system for authenticating users.&lt;/p&gt; &lt;p&gt;ASP.NET membership supports facilities for:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Create a new users and passwords.  &lt;li&gt;Storing membership information (user names, passwords, and supporting data)  &lt;li&gt;Authenticating users who visit your site.  &lt;li&gt;Managing passwords, which includes creating, changing, and resetting them . &lt;/li&gt;&lt;/ul&gt; &lt;div style=&quot;background-color: #c6e6f5&quot;&gt;&amp;lt;membership defaultProvider=&quot;AspSqlMembershipProvider&quot;&amp;gt;&lt;br&gt;&amp;lt;providers&amp;gt;&lt;br&gt;&amp;lt;add name=&quot;AspSqlMembershipProvider&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=&quot;System.Web.Security.SqlMembershipProvider&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connectionStringName=&quot;datasource connection name&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enablePasswordRetrieval=&quot;false&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; enablePasswordReset=&quot;true&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiresQuestionAndAnswer=&quot;false&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; requiresUniqueEmail=&quot;false&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; maxInvalidPasswordAttempts=&quot;5&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minRequiredPasswordLength=&quot;6&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minRequiredNonalphanumericCharacters=&quot;0&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; passwordAttemptWindow=&quot;10&quot;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applicationName=&quot;/&quot; /&amp;gt;&lt;br&gt;&amp;lt;/providers&amp;gt;&lt;br&gt;&amp;lt;/membership&amp;gt;&lt;/div&gt; &lt;div style=&quot;margin: 20px 0px 0px&quot;&gt; &lt;p&gt;&lt;font color=&quot;#c0504d&quot;&gt;SQL Role Provider:&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;text-indent: 40px&quot; align=&quot;justify&quot;&gt;ASP.NET role management helps you to manage authorization, allowing you to specify which resources various users in your application are allowed to access. Role management lets you treat groups of users as a unit by assigning users to roles such as manager, sales, member, and so on. The primary purpose of establishing roles is to give you an easy way to manage access rules for groups of users. You create users and then assign the users to roles (in Windows, to groups). A typical use is to then create a set of pages that you want to restrict to certain users.&lt;/p&gt; &lt;div style=&quot;background-color: #c6e6f5&quot;&gt;&amp;lt;roleManager defaultProvider=&quot;AspSqlRoleProvider&quot; enabled=&quot;true&quot;&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;providers&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;clear /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add connectionStringName=&quot;ApplicationServices&quot; &lt;br&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; applicationName=&quot;/&quot;&lt;br&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; name=&quot;AspSqlRoleProvider&quot;&lt;br&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; type=&quot;System.Web.Security.SqlRoleProvider&quot; /&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/providers&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/roleManager&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/324761053005048470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/07/aspnet-40-providers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/324761053005048470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/324761053005048470'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/07/aspnet-40-providers.html' title='ASP.NET 4.0 Providers'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-1417347513649002588</id><published>2013-07-08T17:08:00.001+05:30</published><updated>2013-07-08T17:21:37.490+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net provider"/><category scheme="http://www.blogger.com/atom/ns#" term="asp.net sql server configuration"/><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)"/><category scheme="http://www.blogger.com/atom/ns#" term="Aspnet_regsql"/><category scheme="http://www.blogger.com/atom/ns#" term="Aspnet_regsql.exe"/><category scheme="http://www.blogger.com/atom/ns#" term="membership provider configuration"/><title type='text'>ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)</title><content type='html'>&lt;div style=&quot;margin: 20px 0px 0px&quot;&gt; &lt;p style=&quot;text-indent: 40px&quot; align=&quot;justify&quot;&gt;The ASP.NET SQL Server registration tool (Aspnet_regsql.exe) is used to create a Microsoft SQL Server database that is used by the SQL Server providers in ASP.NET. The tool is also used to add or remove options from an existing database.&lt;/p&gt; &lt;p style=&quot;text-indent: 40px&quot; align=&quot;justify&quot;&gt;You can run Aspnet_regsql.exe without any command-line arguments to run a wizard that will walk you through specifying connection information for your SQL Server installation, and installing or removing the database elements for the membership, role management, profile, Web Parts personalization, and health monitoring features.&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;goto [ c: -&amp;gt; windows folder -&amp;gt; Microsoft.NET folder -&amp;gt; Framework folder -&amp;gt; folder with version like v 4.0, v3.5 and select the file “aspnet_regsql.exe” ]&lt;/p&gt; &lt;div style=&quot;margin: 20px 0px 0px 20px&quot;&gt; &lt;p&gt;step 1: After double click the &quot;aspnet_regsql.exe&quot; file, the below &lt;/p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMKDm1XXHVgqgLT2-ZFH2hfDec0Oec_7wLre-C3vHeHtZ1ttS3Rk9Eh0dTFWvGTVlCy3gve1p_6-_tTqlr031Z2a0Lhw517ifEJSMIH_LjFespL2zp_h5HfpZqb_HLNE1ttpXAubIkmKhs/s1600-h/1%25255B22%25255D.jpg&quot;&gt;&lt;img title=&quot;ASP.NET SQL SERVER Setup wizard&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;1&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEqikOkohs5_OkCykZNaBNN2qY0g_9HgsBJX7acgr1p4lN48gX8uPJgI8BhGR7foOrPJto58WpWz_0P_TIXuqov_VlZZzqEs_9vQJyeMviUF4UpG25aF5Gy4WMqUnD4LXxR6Le7cvP6ml7/?imgmax=800&quot; width=&quot;446&quot; height=&quot;353&quot;&gt;&lt;/a&gt;  &lt;p&gt;step 2: Click Next to continue the wizard. And select the &quot;Configure SQL server application services&quot;&lt;/p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC3IfTToeh38kZicN7Wc7jioT2JlXSt1XdGHDTehne78cKSCmVRyOI2aOdvJwUpwONg-0OoSmxzqydnMot2fPuufIqkC74yOfO7YulmfsYrGBO6nEcjb64p_JsuZ5co2ETXBgulOJBaoJ_/s1600-h/2%25255B6%25255D.jpg&quot;&gt;&lt;img title=&quot;Configure SQL server application services&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;2&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrR-vwhgFJDzELA9Be3GwhBVW2BaC-sbhuQmSYL22XT6iRrSxeNFUbSbapVc3N4TM-tcfqVoTQbqTe6sh4B41m04f6aQae5tsKh6LdDCqpMbFxCijP7rBGbckRmbAVP-Zzhsd3vOK33CO_/?imgmax=800&quot; width=&quot;446&quot; height=&quot;353&quot;&gt;&lt;/a&gt;  &lt;p&gt;step 3: Click Next to continue the wizard. And select the “Server and Database.”&lt;/p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAADvToNdlhRpUhB6pJVo-KCMH8Q3t8fw5gqgW1Vg5mSKgKHtt6TJa0go776Ob5ovKBQ-5KmO_siqkaMs1grp_6SFnDpmwjtEcxUqRKJq0vZQDW61d21eXra7sZ7AXU2w-qY_ZgVutzRPy/s1600-h/3%25255B8%25255D.jpg&quot;&gt;&lt;img title=&quot;Select the Server and Database&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;3&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipZb-tqPJ95DuHhEXOATK-XFx2ZLrkxSM6kjhjy5VAGUbfGZwamw0udRCOtab6eg7FMQHiU12kExQgpjTOOdZuDAvGYqRfFA_U9lbPDqg7pWevfj-1-6PKiLIEyqAunC9W8d7cCGix5etv/?imgmax=800&quot; width=&quot;446&quot; height=&quot;353&quot;&gt;&lt;/a&gt;  &lt;p&gt;step 4: View the Setting summary details.&lt;/p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-o8ttv6qn_IzmlxKXD4V808pBYpCpmWWqEFifX6eLUdhw2ck9dVmWJv3TpxO0Qti4bfn0kG1PudvSGqmI7-CaH27i8F6tVLLL6wa0XE1Dsa9HMi0-J5_EH-g0WhMbjfbkGisyYB29jAbU/s1600-h/4%25255B11%25255D.jpg&quot;&gt;&lt;img title=&quot;Settings Summary&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;4&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhsKe3xOP1_5_Q8TXVJPfoiRIwVShZEygOR5aA2BSyZ3hyphenhyphennSj09zK9f1t-uMIvJxG5rtT2VQk4y6t0qHX4HMsgEyZY5GLUUQxWfjXjxUzkzu1_Vwqo0SCJZLZcG-vOvEpx4IEGMIQX_UQtZ/?imgmax=800&quot; width=&quot;446&quot; height=&quot;353&quot;&gt;&lt;/a&gt;  &lt;p&gt;step 5: By click finish to Complete the configuration.&lt;/p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiL7bb_e8COiLcIe1w-T3WfkqcUrari78GRimjVF-CjdAezFGjTZv-rv7PkMmzrsZ5BPVmtmoX7CA55xsUC0bBAradIvV1HyvyxQxoAwrLc2m5UvxlBq8E61hrODpNuujIHc58DlsCfAhyphenhyphenW/s1600-h/5%25255B5%25255D.jpg&quot;&gt;&lt;img title=&quot;Complete Configuration&quot; style=&quot;border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px&quot; border=&quot;0&quot; alt=&quot;5&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfNQgB3VA1-EWt3l1yqEzhG0JMy5tpx6YKYMZ-wQyt6MdLkhdsBkhQf9gtYunK6_1Fv5FlpB_UjX3yi2XYLw5VyN6Rj9MsxCXneQRsqMQCRWm3taQMSPwBKsQreGNoY-nRHByOQhs52j8n/?imgmax=800&quot; width=&quot;446&quot; height=&quot;353&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/1417347513649002588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/07/aspnet-sql-server-registration-tool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1417347513649002588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1417347513649002588'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/07/aspnet-sql-server-registration-tool.html' title='ASP.NET SQL Server Registration Tool (Aspnet_regsql.exe)'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEqikOkohs5_OkCykZNaBNN2qY0g_9HgsBJX7acgr1p4lN48gX8uPJgI8BhGR7foOrPJto58WpWz_0P_TIXuqov_VlZZzqEs_9vQJyeMviUF4UpG25aF5Gy4WMqUnD4LXxR6Le7cvP6ml7/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-1826438869400692568</id><published>2013-06-28T18:03:00.002+05:30</published><updated>2021-10-13T15:51:51.778+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="library management sql query"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL library management"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL QUERY Library Management System"/><title type='text'>SQL QUERY Library Management System</title><content type='html'>&lt;div align=&quot;justify&quot; style:=&quot;&quot; width:582px=&quot;&quot;&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;b&gt;Problem Scenario: &lt;/b&gt;This Scenario is to develop a Library Management System (LMS) to store information of the members, books, status of books issue, book availability and suppliers details.&lt;/span&gt;&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;strong&gt;List of Tables:&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Table 1: LMS_MEMBERS &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Table 2: LMS_SUPPLIERS_DETAILS &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Table 3: LMS_FINE_DETAILS &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Table 4:&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
LMS_BOOK_DETAILS  &lt;br /&gt;
Table 5: LMS_BOOK_ISSUE&lt;br /&gt;
&lt;br /&gt;
ER Diagram:&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2Ugmh7ioeClFvH7INNO-zMEwqC-NVcOW6AqfEKd-lo2xCezI4Gi5Iec1d79HfS2e9IwLRN58HO95Jz_tDAk61cGpSKty4EbUFmz5YzxlKmJK5bgZXWDJhzeiL_JDd3Eph_IRepyTWiWFC/s1600-h/image3.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS7go1riQHQowwtYyJWmMCCdmZJVJb15L0rGFpPqvc1Wu_HZXHJnKFNvjlrOcZ4L6I-xyuqOzUbNorj6RdxqXUvkXizUuQ6iZ9o7Y0ZNyUXVPpuFMaPGrOCipakGt7e_v_iWxA2JOqFkhx/?imgmax=800&quot; height=&quot;287&quot; style=&quot;background-image: none; border-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;595&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Database and Table Creations - DDL Queries:&lt;/b&gt;&lt;/td&gt; &lt;td style=&quot;padding-left: 20px;&quot;&gt;&lt;a href=&quot;https://drive.google.com/file/d/0BwjszzqlLXFBd1lGcUpmTWd5ckE/view?usp=sharing&amp;resourcekey=0-9GMKfKZ3wBk4-cJ85z36Eg&quot; target=&quot;_blank&quot;&gt;Download LMS_DDL.sql&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot;&gt;&lt;b&gt;Loading Data - DML Queries:&lt;/b&gt;&lt;/td&gt; &lt;td style=&quot;padding-left: 20px;&quot;&gt;&lt;a href=&quot;https://drive.google.com/file/d/0BwjszzqlLXFBbmd2dkQ3Y2JMVU0/view?usp=sharing&amp;resourcekey=0-vnUdYy1e-z_ho_PzTonkBA&quot; target=&quot;_blank&quot;&gt;Download LMS_DML.sql&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;background-color: #f1c232; color: #646b86;&quot;&gt;Solve this Scenario.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Simple Questions:&lt;/span&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem # 1:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name, city and membership status who are all having life time membership. &lt;b&gt;Hint&lt;/b&gt;: Life time membership status is “Permanent”.  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;Ans:&lt;/span&gt; &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;select member_id,member_name,city,membership_status from LMS_MEMBERS where membership_status=&#39;permanent&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 2:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, publication, price and supplier name of the book witch is taken frequently.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans: &lt;/b&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT b1.book_code,b2.publication,b2.price,b3.supplier_name FROM(SELECT b1.book_code FROM LMS_BOOK_ISSUE b1 GROUP BY book_code HAVING COUNT(b1.BOOK_CODE) &amp;gt; 1) b1 JOIN LMS_BOOK_DETAILS b2 ON b1.book_code = b2.book_code JOIN LMS_SUPPLIERS_DETAILS b3 ON b2.supplier_id = b3.supplier_id &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 3:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name who have taken the book with book code &#39;BL000002&#39;.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans: &lt;/b&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;select b1. member_id,b1.member_name,b2.book_code from LMS_MEMBERS b1,LMS_BOOK_ISSUE b2 where b2.BOOK_CODE=&#39;BL000002&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 4:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, book title and author of the books whose author name begins with &#39;P&#39;.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select book_code,book_title,author from LMS_BOOK_DETAILS where AUTHOR like &#39;P%&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 5:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the total number of Java books available in library with alias name ‘NO_OF_BOOKS’.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select COUNT(category)as NO_OF_BOOKS from LMS_BOOK_DETAILS where CATEGORY=&#39;JAVA&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 6:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to list the category and number of books in each category with alias name ‘NO_OF_BOOKS’.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select category,COUNT(category)as NO_OF_BOOKS from LMS_BOOK_DETAILS group by CATEGORY&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 7:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the number of books published by &quot;Prentice Hall” with the alias name “NO_OF_BOOKS”.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select COUNT(publication) as NO_OF_BOOKS from LMS_BOOK_DETAILS where PUBLICATION=&#39;Prentice Hall&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 8:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, book title of the books which are issued on the date &quot;1&lt;sup&gt;st&lt;/sup&gt; April 2012&quot;.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans(&lt;/b&gt;without issue_date&lt;b&gt;):&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select b1.book_code,b2.book_title from LMS_BOOK_ISSUE b1 inner join LMS_BOOK_DETAILS b2 on b1.BOOK_CODE=b2.BOOK_CODE where b1.DATE_ISSUE=&#39;2012-04-01&#39;&lt;/span&gt;  &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;Ans(&lt;/b&gt;with issue date&lt;b&gt;): &lt;/b&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;select b1.book_code,b1.DATE_ISSUE,b2.book_title from LMS_BOOK_ISSUE b1 inner join LMS_BOOK_DETAILS b2 on b1.BOOK_CODE=b2.BOOK_CODE where b1.DATE_ISSUE=&#39;2012-04-01&#39;&lt;b&gt;&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 9:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name, date of registration and expiry date of the members whose membership expiry date is before APR 2013.  &lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;se&lt;/span&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;lect member_id,member_name,DATE_REGISTER,DATE_EXPIRE from LMS_MEMBERS where DATE_EXPIRE &amp;lt; &#39;2013-04-01&#39; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 10:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
write a query to display the member id, member name, date of registration, membership status of the members who registered before &quot;March 2012&quot; and membership status is &quot;Temporary&quot;  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans: &lt;/b&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;select member_id,member_name,DATE_REGISTER,MEMBERSHIP_STATUS from LMS_MEMBERS where DATE_REGISTER &amp;lt; &#39;2012-03-01&#39; and MEMBERSHIP_STATUS=&#39;Temporary&#39;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem #11:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name who’s City is CHENNAI or DELHI. &lt;b&gt;Hint&lt;/b&gt;: Display the member name in title case with alias name &#39;Name&#39;.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select member_id,member_name as &#39;Name&#39; from LMS_MEMBERS where CITY=&#39;chennai&#39; or CITY=&#39;delhi&#39;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem #12:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to concatenate book title, author and display in the following format.  &lt;br /&gt;
&lt;b&gt;Book_Title&lt;/b&gt;_is_written_by_&lt;b&gt;Author&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;Example: &lt;/b&gt;Let Us C_is_written_by_Yashavant Kanetkar  &lt;br /&gt;
&lt;b&gt;Hint&lt;/b&gt;: display unique books. Use “BOOK_WRITTEN_BY” as alias name.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select book_title + &#39;_is_written_by&#39; + author as &#39;BOOK_WRITTEN_BY&#39; from LMS_BOOK_DETAILS&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem #13:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the average price of books which is belonging to ‘JAVA’ category with alias name “AVERAGEPRICE”.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select AVG(price) as &#39;AVERAGEPRICE&#39; from LMS_BOOK_DETAILS where CATEGORY=&#39;java&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem #14:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the supplier id, supplier name and email of the suppliers who are all having gmail account.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Ans:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select supplier_id,SUPPLIER_NAME,EMAIL from LMS_SUPPLIERS_DETAILS where EMAIL like &#39;%gmail.com&#39;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem#15:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the supplier id, supplier name and contact details. Contact details can be either phone number or email or address with alias name “CONTACTDETAILS”. If phone number is null then display email, even if email also null then display the address of the supplier. &lt;b&gt;Hint&lt;/b&gt;: Use Coalesce function.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ANS:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select Supplier_id,supplier_name,coalesce(contact,email,address) as contactdetails from Lms_suppliers_details&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem#16:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the supplier id, supplier name and contact. If phone number is null then display ‘No’ else display ‘Yes’ with alias name “PHONENUMAVAILABLE”. &lt;b&gt;Hint: &lt;/b&gt;Use ISNULL.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ANS:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select SUPPLIER_ID,SUPPLIER_NAME,case when CONTACT is NULL then &#39;NO&#39; when CONTACT is not null then &#39;YES&#39; end as PHONE_NUM_AVAILABLE from LMS_SUPPLIERS_DETAILS&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem#17:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name, city and member status of members with the total fine paid by them with alias name “Fine”.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ANS:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT m.MEMBER_ID, m.MEMBER_NAME, m.CITY, SUM(f.FINE_AMOUNT) AS FINE FROM LMS_MEMBERS m INNER JOIN LMS_BOOK_ISSUE i ON m.MEMBER_ID = i.MEMBER_ID INNER JOIN LMS_FINE_DETAILS f ON i.FINE_RANGE = f.FINE_RANGE GROUP BY m.MEMBER_ID, m.MEMBER_NAME, m.CITY&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Average Questions:&lt;/span&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem # 1:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name of the members, book code and book title of the books taken by them.  &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ANS: &lt;/b&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;select MEMBER_ID,(select MEMBER_NAME from LMS_MEMBERS where MEMBER_ID=t1.MEMBER_ID )as MEMBER_NAME,BOOK_CODE,(select BOOK_TITLE from LMS_BOOK_DETAILS where BOOK_CODE=t1.BOOK_CODE)as BOOK_TITLE from LMS_BOOK_ISSUE t1&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 2:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the total number of books available in the library with alias name “NO_OF_BOOKS_AVAILABLE” (Which is not issued). &lt;b&gt;Hint:&lt;/b&gt; The issued books details are available in the LMS_BOOK_ISSUE table.  &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;strong&gt;ANS:&lt;/strong&gt;&lt;/span&gt; SELECT COUNT(t1.BOOK_CODE)AS NO_OF_BOOKS_AVAILABLE FROM LMS_BOOK_DETAILS t1 LEFT JOIN LMS_BOOK_ISSUE t2 ON t1.BOOK_CODE = t2.BOOK_CODE WHERE t2.BOOK_CODE IS NULL&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 3:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name, fine range and fine amount of the members whose fine amount is less than 100.  &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT T1.MEMBER_ID,(SELECT MEMBER_NAME FROM LMS_MEMBERS WHERE MEMBER_ID=T1.MEMBER_ID)AS MEMBER_NAME,(SELECT T2.FINE_RANGE FROM LMS_MEMBERS WHERE MEMBER_ID=T1.MEMBER_ID)AS FINE_RANGE,(SELECT FINE_AMOUNT FROM LMS_FINE_DETAILS T2 WHERE FINE_RANGE= T1.FINE_RANGE)AS FINE_AMOUNT FROM LMS_BOOK_ISSUE T1 LEFT JOIN LMS_FINE_DETAILS T2 ON T1.FINE_RANGE = T2.FINE_RANGE WHERE T2.FINE_AMOUNT &amp;lt; 100&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;u&gt;Problem # 4:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, book title, publisher, edition, price and year of publication and sort based on year of publication, publisher and edition.  &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT BOOK_CODE,BOOK_TITLE,PUBLICATION,BOOK_EDITION,PRICE,YEAR(PUBLISH_DATE) AS YEAR_OF_PUBLICATION FROM LMS_BOOK_DETAILS ORDER BY YEAR_OF_PUBLICATION&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 5:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, book title and rack number of the books which are placed in rack &#39;A1&#39; and sort by book title in ascending order.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT BOOK_CODE,BOOK_TITLE,RACK_NUM FROM LMS_BOOK_DETAILS where RACK_NUM=&#39;A1&#39; ORDER BY BOOK_TITLE ASC&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 6:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name, due date and date returned of the members who has returned the books after the due date. &lt;b&gt;Hint: &lt;/b&gt;Date_return is due date and Date_returned is actual book return date.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT MEMBER_ID,(SELECT MEMBER_NAME FROM LMS_MEMBERS WHERE MEMBER_ID=T1.MEMBER_ID)AS MEMBER_NAME,DATE_RETURN AS DUE_DATE,DATE_RETURNED FROM LMS_BOOK_ISSUE T1 WHERE DATE_RETURN &amp;lt; DATE_RETURNED &lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 7:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name and date of registration who have not taken any book.  &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;ANS: &lt;/b&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;SELECT T1.MEMBER_ID,MEMBER_NAME,DATE_REGISTER FROM LMS_MEMBERS T1 LEFT JOIN LMS_BOOK_ISSUE T2 ON T1.MEMBER_ID = T2.MEMBER_ID WHERE T2.MEMBER_ID IS NULL&lt;b&gt;&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem # 8:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a Query to display the member id and member name of the members who has not paid any fine in the year 2012.  &lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: black;&quot;&gt;ANS:&lt;/span&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;Using Sub Query:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;select t1.MEMBER_ID,(select t2.MEMBER_NAME from LMS_MEMBERS t2 where t1.MEMBER_ID=t2.MEMBER_ID)as MEMBER_NAME from LMS_BOOK_ISSUE t1 where t1.DATE_RETURN &amp;gt;=t1.DATE_RETURNED and year(t1.DATE_RETURNED)=2012&lt;/span&gt;  &lt;br /&gt;
(or)  &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;Using Join:&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;span style=&quot;color: #4f81bd;&quot;&gt;select t1.MEMBER_ID,t2.MEMBER_NAME from LMS_BOOK_ISSUE t1 join LMS_MEMBERS t2 on t1.MEMBER_ID=t2.MEMBER_ID where t1.DATE_RETURN&amp;gt;=t1.DATE_RETURNED and YEAR(t1.DATE_RETURNED)=2012&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 9:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the date on which the maximum numbers of books were issued and the number of books issued with alias name “NOOFBOOKS”.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select DATE_ISSUE,count(DATE_ISSUE) as NO_OF_BOOKS from LMS_BOOK_ISSUE group by DATE_ISSUE having COUNT(DATE_ISSUE)=(select MAX(counted) from (select COUNT(DATE_ISSUE) as counted from LMS_BOOK_ISSUE group by DATE_ISSUE) as t)&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 10:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to list the book title and supplier id for the books authored by “Herbert Schildt&quot; and the book edition is 5 and supplied by supplier ‘S01’.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select BOOK_TITLE,SUPPLIER_ID from LMS_BOOK_DETAILS where AUTHOR=&#39;Herbert Schildt&#39; and BOOK_EDITION=&#39;5&#39; and SUPPLIER_ID=&#39;S01&#39;&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 11:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the rack number and the number of books in each rack with alias name “NOOFBOOKS” and sort by rack number in ascending order.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select RACK_NUM,COUNT(book_code) as NO_OF_BOOKS from LMS_BOOK_DETAILS group by RACK_NUM&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 12:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display book issue number, member name, date or registration, date of expiry, book title, category author, price, date of issue, date of return, actual returned date, fine amount.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;Select BOOK_ISSUE_NO,MEMBER_NAME,DATE_REGISTER,DATE_EXPIRE,BOOK_TITLE,CATEGORY, PRICE, DATE_ISSUE,DATE_RETURN,DATE_RETURNED,(select FINE_AMOUNT from LMS_FINE_DETAILS f where i.FINE_RANGE= f.FINE_RANGE)as FINE_AMOUNT from LMS_BOOK_ISSUE i,LMS_MEMBERS m,LMS_BOOK_DETAILS b where i.MEMBER_ID=m.MEMBER_ID and b.BOOK_CODE=i.BOOK_CODE &lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 13:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, title, publish date of the books which is been published in the month of&lt;br /&gt;
December.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select BOOK_CODE,BOOK_TITLE,PUBLISH_DATE from LMS_BOOK_DETAILS where MONTH(PUBLISH_DATE)=&#39;12&#39;&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 14:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, book title ,supplier name and price of the book witch takes maximum price based on each supplier.  &lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select BOOK_CODE,BOOK_TITLE,SUPPLIER_NAME,PRICE from LMS_BOOK_DETAILS b inner join LMS_SUPPLIERS_DETAILS s on b.SUPPLIER_ID=s.SUPPLIER_ID where b.PRICE=(select MAX(PRICE) from LMS_BOOK_DETAILS k where b.SUPPLIER_ID=k.SUPPLIER_ID)&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 15:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display book code, book name, and publisher, how old the book is. Sorted as older to newer.&lt;br /&gt;
&lt;strong&gt;ANS:&lt;/strong&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select BOOK_CODE,BOOK_TITLE,PUBLICATION,YEAR(GETDATE())-YEAR(DATE_ARRIVAL)as YEARS from LMS_BOOK_DETAILS order by YEARS desc&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Complex Questions:&lt;/span&gt;&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem # 1:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the book code, book title and supplier name of the supplier who has supplied maximum number of books. For example, if “ABC Store” supplied 3 books, “LM Store” has supplied 2 books and “XYZ Store” has supplied 1 book. So “ABC Store” has supplied maximum number of books, hence display the details as mentioned below.  &lt;br /&gt;
&lt;b&gt;Example:&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;BOOK_CODE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BOOK_TITLE&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; SUPPLIER_NAME&lt;/b&gt;  &lt;br /&gt;
BL000008&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Easy Reference for Java&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC STORE  &lt;br /&gt;
BL000001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Easy Reference for C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC STORE  &lt;br /&gt;
BL000003&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Easy Reference for VB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ABC STORE  &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;ANS:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select BOOK_CODE,BOOK_TITLE,SUPPLIER_NAME from LMS_BOOK_DETAILS B inner join LMS_SUPPLIERS_DETAILS S on B.SUPPLIER_ID = S.SUPPLIER_ID where S.SUPPLIER_ID in (select SUPPLIER_ID from LMS_BOOK_DETAILS group by SUPPLIER_ID having COUNT(SUPPLIER_ID)=(select MAX(cnt) from (select COUNT(*) as cnt from LMS_BOOK_DETAILS group by SUPPLIER_ID)as T))&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Problem # 2:&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the member id, member name and number of remaining books he/she can take with “REMAININGBOOKS” as alias name. &lt;b&gt;Hint: &lt;/b&gt;Assuming a member can take maximum 3 books. For example, Ramesh has already taken 2 books; he can take only one book now. Hence display the remaining books as 1 in below format.  &lt;br /&gt;
&lt;b&gt;Example: &lt;/b&gt; &lt;br /&gt;
&lt;b&gt;MEMBER_ID&amp;nbsp;&amp;nbsp;&amp;nbsp; MEMBER_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; REMAININGBOOKS&lt;/b&gt;  &lt;br /&gt;
LM001&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; RAMESH&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1  &lt;br /&gt;
LM002&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; MOHAN&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3  &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;ANS:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select m.MEMBER_ID,MEMBER_NAME,T.cb as REMAINING_BOOKS from LMS_MEMBERS m inner join (select a.member_id,COUNT(i.MEMBER_ID) as cb from LMS_MEMBERS a left outer join LMS_BOOK_ISSUE i on a.MEMBER_ID= i.MEMBER_ID group by a.MEMBER_ID)T on T.MEMBER_ID=m.MEMBER_ID&lt;/span&gt; &lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Problem # 3&lt;/u&gt;&lt;/b&gt;  &lt;br /&gt;
Write a query to display the supplier id and supplier name of the supplier who has supplied minimum number of books. For example, if “ABC Store” supplied 3 books, “LM Store” has supplied 2 books and “XYZ Store” has supplied 1 book. So “XYZ Store” has supplied minimum number of books, hence display the details as mentioned below.  &lt;br /&gt;
&lt;b&gt;Example:&lt;/b&gt;  &lt;br /&gt;
&lt;b&gt;SUPPLIER_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUPPLIER_NAME&lt;/b&gt;  &lt;br /&gt;
S04&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XYZ STORE &lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;ANS:&lt;/b&gt; &lt;span style=&quot;color: #4f81bd;&quot;&gt;select S.SUPPLIER_ID,SUPPLIER_NAME from LMS_BOOK_DETAILS B inner join LMS_SUPPLIERS_DETAILS S on B.SUPPLIER_ID = S.SUPPLIER_ID where S.SUPPLIER_ID in (select SUPPLIER_ID from LMS_BOOK_DETAILS group by SUPPLIER_ID having COUNT(SUPPLIER_ID)=(select MIN(cnt) from (select COUNT(*) as cnt from LMS_BOOK_DETAILS group by SUPPLIER_ID)as T))&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #3d85c6; color: white;&quot;&gt;Download Question &amp;amp; Answer&lt;/span&gt;: &lt;a href=&quot;https://docs.google.com/document/d/0BwjszzqlLXFBMmh0SXo2NGFVSWc/edit?usp=sharing&amp;ouid=111690790030914495193&amp;resourcekey=0-vOvUCQZiUj1MyWdNLOnAOA&amp;rtpof=true&amp;sd=true&quot; target=&quot;_blank&quot;&gt;LMS.doc&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/1826438869400692568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/06/sql-query-library-management-system.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1826438869400692568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/1826438869400692568'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/06/sql-query-library-management-system.html' title='SQL QUERY Library Management System'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS7go1riQHQowwtYyJWmMCCdmZJVJb15L0rGFpPqvc1Wu_HZXHJnKFNvjlrOcZ4L6I-xyuqOzUbNorj6RdxqXUvkXizUuQ6iZ9o7Y0ZNyUXVPpuFMaPGrOCipakGt7e_v_iWxA2JOqFkhx/s72-c?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-9127880969320994121</id><published>2013-06-26T12:47:00.001+05:30</published><updated>2013-06-26T13:17:24.992+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net class library"/><category scheme="http://www.blogger.com/atom/ns#" term=".NET Framework"/><category scheme="http://www.blogger.com/atom/ns#" term=".NET Framework Basics"/><category scheme="http://www.blogger.com/atom/ns#" term="class library"/><category scheme="http://www.blogger.com/atom/ns#" term="clr"/><category scheme="http://www.blogger.com/atom/ns#" term="common language runtime"/><category scheme="http://www.blogger.com/atom/ns#" term="difference of .net framework"/><category scheme="http://www.blogger.com/atom/ns#" term="different version of framework"/><title type='text'>.NET Framework Basics</title><content type='html'>&lt;p&gt;&lt;b&gt;&lt;font color=&quot;#4f81bd&quot;&gt;.NET Framework&lt;/font&gt;&lt;/b&gt;  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large library and provides language interoperability (each language can use code written in other languages) across several programming languages. Programs written for the .NET Framework execute in a software environment, known as the &lt;font color=&quot;#4bacc6&quot;&gt;Common Language Runtime&lt;/font&gt; (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. The &lt;font color=&quot;#222222&quot;&gt;&lt;strong&gt;class library&lt;/strong&gt;&lt;/font&gt; and the &lt;strong&gt;CLR&lt;/strong&gt; together constitute the .NET Framework.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework&#39;s Base Class Library provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. Programmers produce software by combining their own source code with the .NET Framework and other libraries. The .NET Framework is intended to be used by most new applications created for the Windows platform. Microsoft also produces an integrated development environment largely for .NET software called Visual Studio.  &lt;p align=&quot;justify&quot;&gt;&lt;strong&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjv7U38gePRd50R7iTjkkktWco1VKrF0ou5j_I0JtmkCh0Wk08mMdY2LCV-rnVbmuQMMxOjdT5p9ZP5SNZtLbzreU6pB9iIKyOElZLDuzFKS7Wc3FFFFcQ7lYqaoQKHatXQIyeU17_mpXyR/s1600-h/DotNet.svg%25255B10%25255D.png&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px&quot; title=&quot;DotNet.svg&quot; border=&quot;0&quot; alt=&quot;DotNet.svg&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXvQ_aYi1Lmy3sRcTVmoKaqLzYn1H1UB3QNIFCsMkLxShwNRzbwQNQqxdaZdI7bBLJo5Ic5yDeOKxBl4-DjgoDAARozBzc8tvXxYUGAsRTPHX7DZh2urISHFfA_WLY9YQl9IZ4XsEfmtO/?imgmax=800&quot; width=&quot;248&quot; height=&quot;281&quot;&gt;&lt;/a&gt;&lt;/strong&gt;  &lt;p&gt;&lt;b&gt;&lt;font color=&quot;#4f81bd&quot;&gt;CLR – Common Language Runtime&lt;/font&gt;&lt;/b&gt;  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET framework provides a run-time environment called the Common Language Runtime, which runs the code &amp;amp; provides services that make the development process easier.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compilers and tools expose the common language runtime&#39;s functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The common language runtime makes it easy to design components and applications whose objects interact across languages. Objects written in different languages can communicate with each other, and their behaviors can be tightly integrated.  &lt;p align=&quot;justify&quot;&gt;&lt;strong&gt;Features:&lt;/strong&gt; &lt;br&gt;1. The common language runtime manages memory, thread execution, code execution, code safety verification, compilation, and other system services. &lt;br&gt;2. The runtime enforces code access security. &lt;br&gt;3. The runtime also enforces code robustness by implementing a strict type-and-code-verification infrastructure called the common type system (CTS). &lt;br&gt;4. The runtime can be hosted by high-performance, server-side applications, such as Microsoft SQL Server and Internet Information Services (IIS).&lt;/p&gt; &lt;p&gt;&lt;b&gt;&lt;font color=&quot;#4f81bd&quot;&gt;.NET Framework Class Library&lt;/font&gt;&lt;/b&gt;  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework class library is a collection of reusable types that tightly integrate with the common language runtime. The class library is object oriented, providing types from which your own managed code can derive functionality. This not only makes the .NET Framework types easy to use, but also reduces the time associated with learning new features of the .NET Framework. In addition, third-party components can integrate seamlessly with classes in the .NET Framework.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework types enable you to accomplish a range of common programming tasks, including tasks such as string management, data collection, database connectivity, and file access. In addition to these common tasks, the class library includes types that support a variety of specialized development scenarios. For example, you can use the .NET Framework to develop the following types of applications and services:  &lt;p align=&quot;justify&quot;&gt;1. Console applications.&lt;br&gt;2. Windows GUI applications (Windows Forms). &lt;br&gt;3. Windows Presentation Foundation (WPF) applications. &lt;br&gt;4. ASP.NET applications. &lt;br&gt;5. Windows services. &lt;br&gt;6. Service-oriented applications using Windows Communication Foundation (WCF). &lt;br&gt;7. Workflow-enabled applications using Windows Workflow Foundation (WF).&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&lt;font color=&quot;#4f81bd&quot;&gt;&lt;b&gt;.NET Framework 4.5&lt;/b&gt; &lt;/font&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework is a development platform for building apps for Windows, Windows Phone, Windows Server, and Windows Azure. It consists of the common language runtime (CLR) and the .NET Framework class library, which includes classes, interfaces, and value types that support an extensive range of technologies. The .NET Framework provides a managed execution environment, simplified development and deployment, and integration with a variety of programming languages, including Visual Basic and Visual C#.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The following are the new features and improvements in the following areas of the .NET Framework 4.5.  &lt;ul&gt; &lt;li&gt;.NET for Windows Store Apps  &lt;li&gt;Portable Class Libraries  &lt;li&gt;Core New Features and Improvements  &lt;li&gt;Tools &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;font color=&quot;#4f81bd&quot;&gt;&lt;b&gt;.NET Framework 4&lt;/b&gt; &lt;/font&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework is an application development platform that provides services for building, deploying, and running desktop, web, and phone applications and web services. It consists of the common language runtime (CLR), which provides memory management and other system services, and an extensive class library, which includes tested, reusable code for all major areas of application development.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The following are the new features and improvements in the following areas of the .NET Framework 4.  &lt;ul&gt; &lt;li&gt;Application Compatibility and Deployment  &lt;li&gt;Core New Features and Improvements  &lt;li&gt;Managed Extensibility Framework  &lt;li&gt;Parallel Computing  &lt;li&gt;Web  &lt;li&gt;Client  &lt;li&gt;Data &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;font color=&quot;#4f81bd&quot;&gt;&lt;b&gt;.NET Framework 3.5&lt;/b&gt;&lt;/font&gt;&lt;/p&gt; &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The .NET Framework is a technology that supports building and running the next generation of applications and Web services. The .NET Framework consists of the common language runtime (CLR) and the .NET Framework class library, which includes ADO.NET, ASP.NET, Windows Forms, and Windows Presentation Foundation (WPF). The .NET Framework provides a managed execution environment, simplified development and deployment, and integration with a wide variety of programming languages.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The following are the new features and improvements in the following areas of the .NET Framework 3.5.&lt;b&gt;&lt;/b&gt;  &lt;ul&gt; &lt;li&gt;.NET Compact Framework  &lt;li&gt;.NET Framework Client Profile  &lt;li&gt;Click Once  &lt;li&gt;Common Language Runtime(CLR) &lt;li&gt;Cryptography  &lt;li&gt;Networking  &lt;li&gt;Windows Forms  &lt;li&gt;LINQ &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;&lt;font color=&quot;#4f81bd&quot;&gt;.NET Framework 3.0&lt;/font&gt;&lt;/b&gt;  &lt;p align=&quot;justify&quot;&gt;&lt;strong&gt;&lt;font color=&quot;#4f81bd&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/strong&gt;The .NET Framework version 3.0 was issued solely to include the following technologies in the .NET Framework and in the Windows Software Development Kit (SDK):  &lt;ul&gt; &lt;li&gt;Windows Communication Foundation (WCF) &lt;li&gt;Windows Presentation Foundation (WPF) &lt;li&gt;Windows Workflow Foundation (WWF) &lt;li&gt;Windows CardSpace&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;&lt;font color=&quot;#4f81bd&quot;&gt;.NET Framework 2.0&lt;/font&gt;&lt;/b&gt;  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The Microsoft .NET Framework version 2.0 extends the .NET Framework version 1.1 with new features, improvements to existing features, and enhancements to the documentation. This section provides information about some key additions and modifications.  &lt;p align=&quot;justify&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The following are the new features and improvements in the following areas of the .NET Framework 2.  &lt;ul&gt; &lt;li&gt;64-bit Platform Support  &lt;li&gt;SQL cache dependency &lt;li&gt;Master Pages &lt;li&gt;Membership and roles &lt;li&gt;Distributed Computing  &lt;li&gt;Generics and Generic Collections  &lt;li&gt;Manifest-Based Activation  &lt;li&gt;Security Exceptions  &lt;li&gt;Serial I/O Device Support  &lt;li&gt;Serialization  &lt;li&gt;Web Services  &lt;li&gt;Windows Forms  &lt;li&gt;XML&lt;/li&gt;&lt;/ul&gt;  </content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/9127880969320994121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/06/net-framework-basics.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/9127880969320994121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/9127880969320994121'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/06/net-framework-basics.html' title='.NET Framework Basics'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeXvQ_aYi1Lmy3sRcTVmoKaqLzYn1H1UB3QNIFCsMkLxShwNRzbwQNQqxdaZdI7bBLJo5Ic5yDeOKxBl4-DjgoDAARozBzc8tvXxYUGAsRTPHX7DZh2urISHFfA_WLY9YQl9IZ4XsEfmtO/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-62503071298427482</id><published>2013-06-18T11:34:00.001+05:30</published><updated>2013-06-18T11:47:08.327+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="database exploration in c# &amp; sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="database exploration using c# &amp; sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="database exploration with c# &amp; sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="database explorer"/><category scheme="http://www.blogger.com/atom/ns#" term="db explorer"/><title type='text'>Database Exploration with C# and SQL Server</title><content type='html'>&lt;p&gt;This is a easy way to explore the items from database.&lt;br&gt;In this Program 3 Modules having:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;module 1:&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select all database name and load into combo box.&lt;br&gt;&lt;strong&gt;module 2:&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select all Table name from particular database and load into list box. &lt;br&gt;&lt;strong&gt;module 3:&lt;/strong&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select all the column name from particular table and load into list box. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Note: &lt;/strong&gt;Here particular database or table means dynamic selection at run time.&lt;/p&gt; &lt;table border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; width=&quot;630&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;628&quot;&gt; &lt;p&gt;namespace db_explore&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public partial class Form1 : Form&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Form1()&lt;br&gt;&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;&amp;nbsp; InitializeComponent();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//Variable declaration&lt;/font&gt;&lt;br&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;&amp;nbsp; SqlConnection con;&lt;br&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;&amp;nbsp; SqlCommand cmd;&lt;br&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;&amp;nbsp; SqlDataReader dr = null;&lt;br&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;&amp;nbsp; String st;&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; &lt;font color=&quot;#ff0000&quot;&gt;//For database&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Form1_Load(object sender, EventArgs e)&lt;br&gt;&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;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//DB Connection string&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con = new SqlConnection();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con.ConnectionString = &quot;Data Source=.\\SQLEXPRESS;Initial Catalog=master;Integrated Security=True&quot;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con.Open();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show(&quot;Successfully Connected.&quot;); &lt;font color=&quot;#4f81bd&quot;&gt;//message notification for database connection&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//select database and load into combo box&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; st = &quot;select name from sys.databases&quot;;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//database selection query&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd = new SqlCommand(st, con);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr = cmd.ExecuteReader();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (dr.Read())&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cbox.Items.Add(dr[0].ToString());&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//add the database names into combo box&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp; dr.Close();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#9bbb59&quot;&gt;&lt;font color=&quot;#ff0000&quot;&gt;//For Table name&lt;/font&gt;&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void cbox_SelectedIndexChanged(object sender, EventArgs e)&lt;br&gt;&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;&amp;nbsp; lbox1.Items.Clear();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;// clearing listbox1&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lbox2.Items.Clear();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;// clearing listbox2&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String ts;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ts = &quot;SELECT * FROM &quot; + cbox.SelectedItem + &quot;.sys.Tables&quot;;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//table selection query for particular DB&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd = new SqlCommand(ts,con);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr = cmd.ExecuteReader();&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//execute data reader&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (dr.Read())&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lbox1.Items.Add(dr[0].ToString());&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//add the table names into listbox2 for particular DB&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp; dr.Close();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#ff0000&quot;&gt;//For column name&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void lbox1_SelectedIndexChanged(object sender, EventArgs e)&lt;br&gt;&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;&amp;nbsp; lbox2.Items.Clear();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//clearing listbox2&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String cs;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//list the column from particular database &amp;amp; table&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cs = &quot;SELECT column_name &#39;Column Name&#39; FROM &quot; + cbox.SelectedItem + &quot;.INFORMATION_SCHEMA.columns WHERE table_name =&#39;&quot;+ lbox1.SelectedItem +&quot;&#39; &quot;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; MessageBox.Show(cs);&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//message for verification of query&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmd = new SqlCommand(cs, con);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dr = cmd.ExecuteReader();&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//execute data reader&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (dr.Read())&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lbox2.Items.Add(dr[0].ToString());&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//add the column names into listbox2 for particular table&lt;br&gt;&lt;/font&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp; dr.Close();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void btn_can_Click(object sender, EventArgs e)&lt;br&gt;&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;&amp;nbsp; this.Close();&amp;nbsp;&amp;nbsp; &lt;font color=&quot;#4f81bd&quot;&gt;//close the application&lt;/font&gt;&lt;br&gt;&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; &lt;br&gt;}&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;It is a dynamic. We can select the database dynamically to explore the content for tables available in database and we can select the table name to explore the column names for particular table.&lt;/p&gt; &lt;p&gt;&lt;font color=&quot;#4f81bd&quot;&gt;For download full program:&lt;/font&gt; &lt;a href=&quot;https://docs.google.com/file/d/0BwjszzqlLXFBQlFneUdwQmZqWjg/edit&quot; target=&quot;_blank&quot;&gt;db_explorer.rar&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Sample output:&lt;/p&gt; &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3ABXYbb331jjSsH4HMPt4gUNHCYvhGN9YPEscKSkqIj5f_TscLnrEgnee034ugbrHgedwX9bmzbCUrO12BdTAOgiheYGdbbszWJ8CWiuKa837IZfH_JKjpemqMThruMSVNmzioK12iV1a/s1600-h/db1%25255B2%25255D.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;db1&quot; border=&quot;0&quot; alt=&quot;db1&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM7qHMDqhxwQekIFQY0HNUJ1PpexznyOmJFQcDCgjx8FuBWPczpDXQ_V8YhC9xgKq4wU165Z5HzgFJX_l9zcrCxX_rTiaDb2cVTB9i1M7xppiEO35xX1T7Pxz-KRzigaP5wQwATe0UjRzx/?imgmax=800&quot; width=&quot;290&quot; height=&quot;250&quot;&gt;&lt;/a&gt; &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisCucQ2Omi1HagGqThHf9jS8E-c_kf7WqF6PssCLexeQxYvnp5pU2QXy5XCZdq1EL1ffbQO1QtF1D-oUboI-Ze3he_XBJcvQywdPZ-2L3M3WWHhEfQCfhINfI4FyrxSlhUtLe_zOd0FMEM/s1600-h/db2%25255B2%25255D.jpg&quot;&gt;&lt;img style=&quot;background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px&quot; title=&quot;db2&quot; border=&quot;0&quot; alt=&quot;db2&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJs1zpBIfBD7k-mbuC9ULVvIpqeHbnfUJnWZFpgU9WdwHRdMfQdrRPPtk8aLHLV6gxgvXh2ySEIcFeK2_zc31GnsY0vHS7Vr_BBUsLB95wifHjozQvDgUTe38TRVe01F1GYJjndgxuNNl1/?imgmax=800&quot; width=&quot;290&quot; height=&quot;250&quot;&gt;&lt;/a&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/62503071298427482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/06/database-exploration-with-c-and-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/62503071298427482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/62503071298427482'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/06/database-exploration-with-c-and-sql.html' title='Database Exploration with C# and SQL Server'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiM7qHMDqhxwQekIFQY0HNUJ1PpexznyOmJFQcDCgjx8FuBWPczpDXQ_V8YhC9xgKq4wU165Z5HzgFJX_l9zcrCxX_rTiaDb2cVTB9i1M7xppiEO35xX1T7Pxz-KRzigaP5wQwATe0UjRzx/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-5671879640689096897</id><published>2013-06-17T18:20:00.001+05:30</published><updated>2013-07-09T11:56:47.374+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# basics"/><category scheme="http://www.blogger.com/atom/ns#" term="C# oops"/><category scheme="http://www.blogger.com/atom/ns#" term="Oops Concept in C#"/><title type='text'>OOPS concept in C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;1.Class&lt;/span&gt;:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Class is group of object that share common properties and relationships.  &lt;/li&gt;
&lt;li&gt;Class members are private by default.  &lt;/li&gt;
&lt;li&gt;Classes are reference type that is they are stored on heap.  &lt;/li&gt;
&lt;li&gt;Class can be inherited and but can be instantiated.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 208px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;206&quot;&gt;&lt;div align=&quot;left&quot;&gt;
Class Employee&lt;br /&gt;{&lt;br /&gt;public in CustID;&lt;br /&gt;public in CustName;&lt;br /&gt;}&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;span style=&quot;color: #4f81bd; font-size: small;&quot;&gt;2.Structure:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Structure is collection of different types of data types.  &lt;/li&gt;
&lt;li&gt;Structure members are public by default.  &lt;/li&gt;
&lt;li&gt;Structure are value type that is they are stored on stack.  &lt;/li&gt;
&lt;li&gt;Structure can not be inherited but can be instantiated.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 208px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;206&quot;&gt;Struct Employee&lt;br /&gt;{&lt;br /&gt;public int CustID;&lt;br /&gt;public string name;&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;&lt;span style=&quot;color: #4f81bd; font-size: small;&quot;&gt;3.Object:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Object is basic runtime entity OR object is instance of class.  &lt;/li&gt;
&lt;li&gt;Object consistsof data and function together.  &lt;/li&gt;
&lt;li&gt;Object allows designing systems that are more robust and portable through the proper application of abstraction.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;public class Student&lt;br /&gt;{&lt;br /&gt;public string First_Name { get; set; }&lt;br /&gt;public int Weight { get; set; }&lt;br /&gt;public Person(string First_Name, int Weight)&lt;br /&gt;{&lt;br /&gt;First_Name = first_Name;&lt;br /&gt;Weight = weight;&lt;br /&gt;}&lt;br /&gt;//Other properties, methods, events...&lt;br /&gt;}&lt;br /&gt;class Program&lt;br /&gt;{&lt;br /&gt;static void Main()&lt;br /&gt;{&lt;br /&gt;Student person1 = new Student(&quot;Anil&quot;, 66);&lt;br /&gt;Console.WriteLine(&quot;Student First_Name = {0} Weight = {1}&quot;, person1.First_Name, person1.Weight);&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Output:&lt;br /&gt;
Student First_Name = Anil Weight = 66&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;color: #4f81bd; font-size: small;&quot;&gt;&lt;strong&gt;4.Abstraction:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify; text-indent: 40px;&quot;&gt;
Abstraction is one of the principle of object oriented programming. It is used to display only necessary and essential features of an object to ouside the world.Means displaying what is necessary and encapsulate the unnecessary things to outside the world.Hiding can be achieved by using &quot;private&quot; access modifiers.&lt;br /&gt;&lt;strong&gt;Note&lt;/strong&gt; - Outside the world means when we use reference of object then it will show only necessary methods and properties and hide methods which are not necessary.&lt;/div&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 466px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;464&quot;&gt;namespace Abstraction&lt;br /&gt;{&lt;br /&gt;public abstract class Shape&lt;br /&gt;{&lt;br /&gt;private float _area;&lt;br /&gt;private float _perimeter;&lt;br /&gt;public float Area&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _area;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_area = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public float Perimeter&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return _perimeter;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;_perimeter = value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public abstract void CalculateArea();&lt;br /&gt;public abstract void CalculatePerimeter();&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;text-align: justify; text-indent: 40px;&quot;&gt;
Advantages of abstraction are the hiding of implementation details, component reuse, extensibility, and testability. When we hide implementation details, we reveal a cleaner, more comprehensible and usable interface to our users. We are separating our interface from our implementation, and this makes component reuse more practical. Many, if not all of the object-oriented concepts we have discussed throughout this document play a role in the abstraction principle. Working together, their end goal is the same, to produce software that is flexible, testable, maintainable, and extensible.&lt;/div&gt;
&lt;strong&gt;&lt;span style=&quot;color: #4f81bd; font-size: small;&quot;&gt;5.Data Encapsulation:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Encapsulation, in the context of C#, refers to an object&#39;s ability to hide data and behavior that are not necessary to its user.  &lt;/li&gt;
&lt;li&gt;Encapsulation enables a group of properties, methods and other members to be considered a single unit or object.  &lt;/li&gt;
&lt;li&gt;Encapsulation is also known as information hiding.  &lt;/li&gt;
&lt;li&gt;An encapsulated object is often called an abstract data type.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;public class School&lt;br /&gt;{&lt;br /&gt;private string Schooldepartname;&lt;br /&gt;public string SchoolDepartname&lt;br /&gt;{&lt;br /&gt;get&lt;br /&gt;{&lt;br /&gt;return Schooldepartname;&lt;br /&gt;}&lt;br /&gt;set&lt;br /&gt;{&lt;br /&gt;Schooldepartname =value;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class Departmentmain&lt;br /&gt;{&lt;br /&gt;public static int Main(string[] args)&lt;br /&gt;{&lt;br /&gt;School d= new School();&lt;br /&gt;d.SchoolDepartname=&quot;Communication&quot;;&lt;br /&gt;Console.WriteLine(&quot;The Dept. Name is :{0}&quot;,d.SchoolDepartname);&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Output:&lt;br /&gt;
The Dept. Name is : Communication&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Benefits of Encapsulation :&lt;/strong&gt; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;In Encapsulation fields of a class can be read-only or can be write-only.  &lt;/li&gt;
&lt;li&gt;A class can have control over in its fields.  &lt;/li&gt;
&lt;li&gt;A class can change data type of its fields anytime but users of this class do not need to change any code.&lt;/li&gt;
&lt;/ul&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;color: #4f81bd; font-size: small;&quot;&gt;6. Inheritance:&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt;Inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined.  &lt;/li&gt;
&lt;li&gt;Inheritance is employed to help reuse existing code with little or no modification.  &lt;/li&gt;
&lt;li&gt;The new classes, known as Sub-class or derived class, inherit attributes and behavior of the pre-existing classes, which are referred to as Super-class or Base class.&lt;/li&gt;
&lt;/ul&gt;
C# supports two types of Inheritance mechanisms&lt;br /&gt; &lt;br /&gt;
&lt;div style=&quot;text-indent: 60px;&quot;&gt;
1) Implementation Inheritance&lt;/div&gt;
&lt;div style=&quot;text-indent: 60px;&quot;&gt;
2) Interface Inheritance&lt;/div&gt;
&lt;u&gt;Implementation Inheritance:&lt;/u&gt; &lt;div style=&quot;text-indent: 50px;&quot;&gt;
When a class (type) is derived from another class (type) such that it inherits all the members of the base type it is Implementation Inheritance.&lt;/div&gt;
&lt;u&gt;Interface Inheritance:&lt;/u&gt; &lt;div style=&quot;text-indent: 50px;&quot;&gt;
When a type (class or a struct) inherits only the signatures of the functions from another type it is Interface Inheritance.&lt;/div&gt;
&lt;strong&gt;Benefits of using Inheritance:&lt;/strong&gt;  &lt;ul style=&quot;text-align: justify;&quot;&gt;
&lt;li&gt;Once a behavior (method) or property is defined in a super class (base class),that behavior or property is automatically inherited by all subclasses (derived class).  &lt;/li&gt;
&lt;li&gt;Code reusability increased through inheritance&lt;br /&gt;Inheritance provide a clear model structure which is easy to understand without much complexity.  &lt;/li&gt;
&lt;li&gt;Using inheritance, classes become grouped together in a hierarchical tree structure.  &lt;/li&gt;
&lt;li&gt;Code are easy to manage and divided into parent and child classes.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;public class ParentClass&lt;br /&gt;{&lt;br /&gt;public ParentClass()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Parent Constructor.&quot;);&lt;br /&gt;}&lt;br /&gt;public void print()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Parent Class.&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class ChildClass : ParentClass&lt;br /&gt;{&lt;br /&gt;public ChildClass()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Child Constructor.&quot;);&lt;br /&gt;}&lt;br /&gt;public static void Main()&lt;br /&gt;{&lt;br /&gt;ChildClass child = new ChildClass();&lt;br /&gt;child.print();&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Output:&lt;br /&gt;
Parent Constructor.&lt;br /&gt;
Child Constructor.&lt;br /&gt;
Parent Class.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;color: #4f81bd; font-size: small;&quot;&gt;7. Polymorphism:&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;text-indent: 40px;&quot;&gt;
It allows you to invoke derived class methods through a base class reference during run-time. Polymorphism is extensively used in implementing Inheritance.&lt;/div&gt;
&lt;div style=&quot;text-indent: 40px;&quot;&gt;
The Polymorphism can be classified into 2 types:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Compile Time Polymorphism (Method Overloading)  &lt;/li&gt;
&lt;li&gt;Run Time Polymorphism (Method Overriding)&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;public class Customer&lt;br /&gt;{&lt;br /&gt;public virtual void CustomerType()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;I am a customer&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class CorporateCustomer : Customer&lt;br /&gt;{&lt;br /&gt;public override void CustomerType()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;I am a corporate customer&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class PersonalCustomer : Customer&lt;br /&gt;{&lt;br /&gt;public override void CustomerType()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;I am a personal customer&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;public class MainClass&lt;br /&gt;{&lt;br /&gt;public static void Main()&lt;br /&gt;{&lt;br /&gt;Customer[] C = new Customer[3];&lt;br /&gt;C[0] = new CorporateCustomer();&lt;br /&gt;C[1] = new PersonalCustomer();&lt;br /&gt;C[2] = new Customer();&lt;br /&gt;foreach (Customer CustomerObject in C)&lt;br /&gt;{&lt;br /&gt;CustomerObject.CustomerType();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Output:&lt;br /&gt;
I am a corporate customer.&lt;br /&gt;
I am a personal customer.&lt;br /&gt;
I am a customer.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Method Overloading ( Compile Time Polymorphism):&lt;/strong&gt;&lt;br /&gt;
 &lt;ul&gt;
&lt;li&gt;Method with same name but with different arguments is called method overloading.  &lt;/li&gt;
&lt;li&gt;Method Overloading forms compile-time polymorphism.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;class A1&lt;br /&gt;{&lt;br /&gt;void hello()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Hello&quot;);&lt;br /&gt;}&lt;br /&gt;void hello(string s)&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Hello {0}&quot;, s);&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;strong&gt;Method Overriding ( Run Time Polymorphism):&lt;/strong&gt;&lt;br /&gt;
 &lt;ul&gt;
&lt;li&gt;Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.  &lt;/li&gt;
&lt;li&gt;Method overriding forms Run-time polymorphism.  &lt;/li&gt;
&lt;li&gt;Note: By default functions are not virtual in C# and so you need to write “virtual” explicitly. While by default in Java each function are virtual. &lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;class parent&lt;br /&gt;{&lt;br /&gt;virtual void hello()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Hello from Parent&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;class child : parent&lt;br /&gt;{&lt;br /&gt;override void hello()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Hello from Child&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;static void main()&lt;br /&gt;{&lt;br /&gt;parent objParent = new child();&lt;br /&gt;objParent.hello();&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Output:&lt;br /&gt;
Hello from Child.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;8.Interface:&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
 &lt;ul&gt;
&lt;li&gt;Interface is nothing but an contract of the system which can be implemented on accounts.  &lt;/li&gt;
&lt;li&gt;.Net doesn&#39;t support the multiple inheritance directly but using interfaces we can achieve multiple inheritance in .net.  &lt;/li&gt;
&lt;li&gt;An Interface can only contains abstract members and it is a reference type.  &lt;/li&gt;
&lt;li&gt;Interface members can be Methods, Properties, Events and Indexers. But the interfaces only contains declaration for its members.  &lt;/li&gt;
&lt;li&gt;Class which inherits interface needs to implement all it&#39;s methods.  &lt;/li&gt;
&lt;li&gt;All declared interface member are implicitly public.&lt;/li&gt;
&lt;/ul&gt;
&lt;table align=&quot;center&quot; border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 509px;&quot;&gt; &lt;tbody&gt;
&lt;tr&gt; &lt;td valign=&quot;top&quot; width=&quot;507&quot;&gt;class Program&lt;br /&gt;{&lt;br /&gt;interface BaseInterface&lt;br /&gt;{&lt;br /&gt;void BaseInterfaceMethod();&lt;br /&gt;}&lt;br /&gt;interface DerivedInterface : BaseInterface&lt;br /&gt;{&lt;br /&gt;void DerivedToImplement();&lt;br /&gt;}&lt;br /&gt;class InterfaceImplementer : DerivedInterface&lt;br /&gt;{&lt;br /&gt;public void DerivedToImplement()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Method of Derived Interface called.&quot;);&lt;br /&gt;}&lt;br /&gt;public void BaseInterfaceMethod()&lt;br /&gt;{&lt;br /&gt;Console.WriteLine(&quot;Method of Base Interface called.&quot;);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;static void Main(string[] args)&lt;br /&gt;{&lt;br /&gt;InterfaceImplementer er = new InterfaceImplementer();&lt;br /&gt;er.DerivedToImplement();&lt;br /&gt;er.BaseInterfaceMethod();&lt;br /&gt;Console.Read();&lt;br /&gt;}&lt;br /&gt;}&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;Output:&lt;br /&gt;
Method of Derived Interface called.&lt;br /&gt;
Method of Base Interface called.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/5671879640689096897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2013/06/oops-concept-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/5671879640689096897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/5671879640689096897'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2013/06/oops-concept-in-c.html' title='OOPS concept in C#'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8327079126128012656.post-6355668103040806915</id><published>2012-10-31T16:26:00.000+05:30</published><updated>2013-06-26T13:18:32.672+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Save Image into SQL Server via VB.net"/><category scheme="http://www.blogger.com/atom/ns#" term="store image into database using vb.net"/><category scheme="http://www.blogger.com/atom/ns#" term="store picture into database"/><title type='text'>Save Image into SQL Server via VB.net</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;span style=&quot;color: #cc0000;&quot;&gt;&lt;u&gt;OpenFileDialog for browse the Image and showing in picture box.&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0b5394;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;OpenFileDialog1.Filter = &quot;Image File (*.jpg;*.bmp;*.gif)|*.jpg;*.bmp;*.gif&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sfile = OpenFileDialog1.FileName &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39; Store the file name in variable &quot;sfile&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pbox.Image = System.Drawing.Bitmap.FromFile(sfile)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pbox.SizeMode = PictureBoxSizeMode.StretchImage&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;u&gt;Convert image into Byte using Filestream&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;Try&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim fs As FileStream&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fs = New FileStream(sfile, FileMode.Open, FileAccess.Read) &lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Pass the sfile value&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim picByte As Byte() = New Byte(fs.Length - 1) {}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fs.Read(picByte, 0, System.Convert.ToInt32(fs.Length))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fs.Close()&lt;/span&gt;&lt;br /&gt;
&lt;u style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/u&gt;
&lt;u style=&quot;color: #cc0000;&quot;&gt;Insert statement for SQL query&lt;/u&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim sqltxt As String&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sqltxt = &quot;insert into nstudent values(&#39;&quot; &amp;amp; txt_sID.Text &amp;amp; &quot;&#39;,&#39;&quot; &amp;amp; txt_fname.Text &amp;amp; &quot;&#39;,&#39;&quot; &amp;amp; &amp;nbsp; txt_lname.Text &amp;amp; &quot;&#39;,&#39;&quot; &amp;amp; cmb_gender.Text &amp;amp; &quot;&#39;,&#39;&quot; &amp;amp; txt_dob.Text &amp;amp; &quot;&#39;,&#39;&quot; &amp;amp; txt_addr.Text &amp;amp; &quot;&#39;,&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;@photo&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;)&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;u&gt;Store image as Binary value using SQLParameter&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #3d85c6;&quot;&gt;Dim imgP As New SqlParameter&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; imgP.SqlDbType = SqlDbType.Binary&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; imgP.ParameterName = &quot;&lt;/span&gt;&lt;span style=&quot;color: #e69138;&quot;&gt;photo&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; imgP.Value = picByte&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sqlcmd = New SqlCommand(sqltxt, con)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sqlcmd.Parameters.Add(imgP)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sqlcmd.ExecuteNonQuery()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox(&quot;Data Saved Successfully&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sqlcmd.Dispose()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;con.Dispose()&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&lt;/span&gt; Catch ex As Exception&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MessageBox.Show(ex.Message)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;End Try&lt;br /&gt;
&lt;u style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/u&gt;
&lt;u style=&quot;color: #cc0000;&quot;&gt;Retrieve&amp;nbsp;Image from database and set in Picture box&lt;/u&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sub rimage(ByVal imgno As Integer) &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&#39;User created Function &quot;rimage&quot;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If pbox.Image IsNot Nothing Then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&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;pbox.Image.Dispose()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Dim arr() As Byte&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;arr = dr.Item(imgno) &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt; &#39;Pass the varaible imgno from funciton &quot;rimage&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pbox.Image = Image.FromStream(New IO.MemoryStream(arr))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pbox.SizeMode = PictureBoxSizeMode.StretchImage&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/span&gt;&lt;br /&gt;
&lt;u style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/u&gt;
&lt;u style=&quot;color: #cc0000;&quot;&gt;Using select command for&amp;nbsp;retrieving&amp;nbsp;data from database&lt;/u&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;Dim s as String&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s = &quot;Select * from nstudent where sID = &#39;&quot; &amp;amp; valu &amp;amp; &quot;&#39;&quot; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Getting input using InputBox &amp;amp; store the value in string varaible&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;Dim cmd As New SqlCommand(s, con)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dr = cmd.ExecuteReader&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;Dim n As Byte&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; n = dr.Read()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If n &amp;gt; 0 Then&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txt_sID.Text = dr.Item(0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txt_fname.Text = dr.Item(1)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txt_lname.Text = dr.Item(2)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cmb_gender.Text = dr.Item(3)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txt_dob.Text = dr.Item(4)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; txt_addr.Text = dr.Item(5)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Call rimage(6) &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;&lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39;Call the Function&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Else&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox(&quot;NotFound&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If Not dr.IsClosed Then dr.Close()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #3d85c6;&quot;&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://programtechn.blogspot.com/feeds/6355668103040806915/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://programtechn.blogspot.com/2012/10/save-image-into-sql-server-via-vbnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/6355668103040806915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8327079126128012656/posts/default/6355668103040806915'/><link rel='alternate' type='text/html' href='http://programtechn.blogspot.com/2012/10/save-image-into-sql-server-via-vbnet.html' title='Save Image into SQL Server via VB.net'/><author><name>Programmer</name><uri>http://www.blogger.com/profile/10015768864173721046</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>India</georss:featurename><georss:point>10.925011415607088 79.837646484375</georss:point><georss:box>10.426167915607088 79.192199484375 11.423854915607087 80.483093484375</georss:box></entry></feed>