<?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-2032195248484634804</id><updated>2024-09-04T06:31:46.812-07:00</updated><category term="Operator overloading"/><category term="c#"/><category term="dataadapter"/><category term="datareader"/><category term="polymorphism"/><title type='text'>Interview question</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://conceptscorner.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://conceptscorner.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Naresh Penneti&#39;s Blog</name><uri>http://www.blogger.com/profile/04709988981629671389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8DPOyItkMPtsT9ZMCoS0gUr_g0S3HJYw2VGKjdwU5ukyNor0c_-KTlgijA40DN6cKnj8MXM7clUWtrkGPWvziBd2OXhgBiI0l6fvAKgh0ef1WTGWdkCnKr8uXdZzJIFg/s220/DSC01222.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2032195248484634804.post-8500074818683135130</id><published>2010-03-18T02:50:00.000-07:00</published><updated>2010-03-18T02:56:49.425-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Operator overloading"/><category scheme="http://www.blogger.com/atom/ns#" term="polymorphism"/><title type='text'>What is operator overloading with an example.</title><content type='html'>&lt;p&gt;In &lt;a href=&quot;http://en.wikipedia.org/wiki/Computer_programming&quot; title=&quot;Computer programming&quot;&gt;computer programming&lt;/a&gt;, &lt;b&gt;operator  overloading&lt;/b&gt; (less commonly known as operator &lt;a href=&quot;http://en.wikipedia.org/wiki/Ad-hoc&quot; title=&quot;Ad-hoc&quot; class=&quot;mw-redirect&quot;&gt;ad-hoc&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Type_polymorphism&quot; title=&quot;Type  polymorphism&quot;&gt;polymorphism&lt;/a&gt;) is a specific case of &lt;a href=&quot;http://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29&quot; title=&quot;Polymorphism (computer science)&quot; class=&quot;mw-redirect&quot;&gt;polymorphism&lt;/a&gt;  in which some or all of &lt;a href=&quot;http://en.wikipedia.org/wiki/Operator_%28programming%29&quot; title=&quot;Operator (programming)&quot;&gt;operators&lt;/a&gt; like &lt;tt&gt;+&lt;/tt&gt;, &lt;tt&gt;=&lt;/tt&gt;,  or &lt;tt&gt;==&lt;/tt&gt; have different implementations depending on the types of  their arguments. Sometimes the overloadings are defined by the  language; sometimes the programmer can implement support for new types.&lt;/p&gt; Operator overloading is useful because it allows the developer to  program using notation closer to the target domain and allows user types  to look like types built into the language. It can easily be emulated  using function calls;&lt;br /&gt;&lt;br /&gt;This is a very useful link if you need what are the operators that can be overloaded.&lt;br /&gt;&lt;br /&gt;http://www.csharphelp.com/2006/03/c-operator-overloading/</content><link rel='replies' type='application/atom+xml' href='http://conceptscorner.blogspot.com/feeds/8500074818683135130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conceptscorner.blogspot.com/2010/03/what-is-operator-overloading-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default/8500074818683135130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default/8500074818683135130'/><link rel='alternate' type='text/html' href='http://conceptscorner.blogspot.com/2010/03/what-is-operator-overloading-with.html' title='What is operator overloading with an example.'/><author><name>Naresh Penneti&#39;s Blog</name><uri>http://www.blogger.com/profile/04709988981629671389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8DPOyItkMPtsT9ZMCoS0gUr_g0S3HJYw2VGKjdwU5ukyNor0c_-KTlgijA40DN6cKnj8MXM7clUWtrkGPWvziBd2OXhgBiI0l6fvAKgh0ef1WTGWdkCnKr8uXdZzJIFg/s220/DSC01222.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2032195248484634804.post-7918686848336932059</id><published>2010-03-17T01:22:00.001-07:00</published><updated>2010-03-17T02:05:22.079-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="dataadapter"/><category scheme="http://www.blogger.com/atom/ns#" term="datareader"/><title type='text'>What is the difference between datareader and dataadapter.</title><content type='html'>&lt;span style=&quot;font-family: arial;font-size:100%;&quot; &gt;This is general typical question asked in the interview.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; font-family: arial;font-size:100%;&quot; &gt;Datareader :&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: arial;font-size:100%;&quot; &gt;1)&lt;/span&gt;&lt;span style=&quot;font-weight: bold; font-family: arial;font-size:100%;&quot; &gt; &lt;/span&gt;&lt;span style=&quot;font-family: arial;font-family:Arial;font-size:100%;color:BLACK;&quot;   &gt;Data Reader will read only one record  at a time.So memory consumption will be less,it is purely connection  oriented it will use connection exclusively when datareader is  closed.the memory will be released on the server machine and connection  will be used for any other purpose.&lt;br /&gt;&lt;br /&gt;2) &lt;/span&gt;&lt;span style=&quot;font-family: arial;font-size:100%;&quot; &gt;Retrieves a forward-only, read-only data stream from a data source.&lt;br /&gt;&lt;br /&gt;3) Datareader reads the row by row. One row at a time.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;DataAdapter:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1) Bridges the connected classes  with the disconnected classes by retrieving data from a data source and filling  a (disconnected) DataSet. The DataAdapter&lt;a name=&quot;with changes&quot;&gt;&lt;/a&gt; also updates the data source with changes made to a  disconnected DataSet. The DataAdapter uses the  Connection&lt;a name=&quot;four&quot;&gt;&lt;/a&gt; object to connect the data source and up to  four Command&lt;a name=&quot;resolve changes&quot;&gt;&lt;/a&gt; objects to retrieve data  from and resolve changes (i.e., update, insert, and delete rows) to the data  source. The DataAdapter&lt;a name=&quot;the &quot;&gt;&lt;/a&gt; object is specific to the  type of data source—for example, the .NET Framework data provider for SQL Server  includes the SqlDataAdapter object.&lt;a name=&quot;idx-CHP-1-0023&quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: arial;font-family:Arial;font-size:100%;color:BLACK;&quot;   &gt;&lt;br /&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://conceptscorner.blogspot.com/feeds/7918686848336932059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conceptscorner.blogspot.com/2010/03/what-is-difference-between-datareader.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default/7918686848336932059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default/7918686848336932059'/><link rel='alternate' type='text/html' href='http://conceptscorner.blogspot.com/2010/03/what-is-difference-between-datareader.html' title='What is the difference between datareader and dataadapter.'/><author><name>Naresh Penneti&#39;s Blog</name><uri>http://www.blogger.com/profile/04709988981629671389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8DPOyItkMPtsT9ZMCoS0gUr_g0S3HJYw2VGKjdwU5ukyNor0c_-KTlgijA40DN6cKnj8MXM7clUWtrkGPWvziBd2OXhgBiI0l6fvAKgh0ef1WTGWdkCnKr8uXdZzJIFg/s220/DSC01222.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2032195248484634804.post-5913196409967410693</id><published>2010-03-10T18:08:00.000-08:00</published><updated>2010-03-12T01:05:05.534-08:00</updated><title type='text'>What are delegates??</title><content type='html'>Hello Guys,&lt;br /&gt;This is the common interview question that every one asks to an experienced employee. The questions follow like this.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;What are delegates? What is the practical approach to use delegate?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;What are multicast delegates??&lt;/span&gt;&lt;br /&gt;In my blog I will explain what they are.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Delegate:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;(MSDN def)&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;A &lt;a id=&quot;ctl00_MTCS_main_ctl01&quot; onclick=&quot;javascript:Track(&#39;ctl00_MTCS_main_ctl00ctl00_MTCS_main_ctl01&#39;,this);&quot; href=&quot;http://msdn.microsoft.com/en-us/library/900fyy8e%28VS.80%29.aspx&quot;&gt;delegate&lt;/a&gt; is a type that references a method. Once a delegate is assigned a method, it behaves exactly like that method. The delegate method can be used like any other method, with parameters and a return value, &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-QLaWfTVFycHPhP96B6gDyXnPpceWNe99ei9FZZkDWBvqPNE-GMrnrifWnqxXhcPaWlAGOATpWMuUsv_UU5pO4Kxo5V66TR0EkMGS3ZgRLcp8qo6CBy5-kin3hcxxoiVP6pEYAJN1XMs/s1600-h/delegate.JPG&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5447280787594998946&quot; style=&quot;float: left; margin: 0px 10px 10px 0px; width: 320px; height: 240px;&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-QLaWfTVFycHPhP96B6gDyXnPpceWNe99ei9FZZkDWBvqPNE-GMrnrifWnqxXhcPaWlAGOATpWMuUsv_UU5pO4Kxo5V66TR0EkMGS3ZgRLcp8qo6CBy5-kin3hcxxoiVP6pEYAJN1XMs/s320/delegate.JPG&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; An Image worth thousand words. In the image I delcared a delegate with the name perform , takes a input integer paramter, and produces output int parameter.&lt;/p&gt;&lt;p&gt;So any methods with the input int parameter and output int paramter are ready to go to the delegate place.&lt;/p&gt;&lt;p&gt;In the class a, instantiating delegate and assigning it to method(square or Cube). They both are ready to act in place of delegate since they have same signature.&lt;/p&gt;&lt;p&gt;Now &lt;/p&gt;&lt;p&gt;Op(2) means that Sqaure(2) &lt;/p&gt;&lt;p&gt;Op1(2) means Cube(2)&lt;/p&gt;&lt;p&gt;Thats the power of Delegate, it acts like any other methods.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms173175%28VS.80%29.aspx&quot;&gt;Multicast Delegates:&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;strong&gt;&lt;/strong&gt;If a delegate points to more than one function at a time then it is called multicast delegate.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Think we have 4 delegate instances   a , b ,c , d&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ex: Perform  a, b, c, d;&lt;/div&gt;&lt;div&gt;      a= Square;&lt;/div&gt;&lt;div&gt;      b = Cube;&lt;/div&gt;&lt;div&gt;     c = a + b;&lt;/div&gt;&lt;div&gt;    d = c - a;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Resposnse.Write(c(2).ToString());&lt;br /&gt;Response.Write(d(2).ToString());&lt;br /&gt;&lt;br /&gt;The outputs will be 8&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;So guys are you ready to face the interview. So here are the definitions:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Delegate : &lt;/span&gt;A delegate is a function pointer , where the functions will have the same signature as of delegate. input and output parameters are same.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 153, 0);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Multicast delegate:&lt;/span&gt; If a delegate calling more than one function, then it is calling Multicast delegate.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;All the best.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conceptscorner.blogspot.com/feeds/5913196409967410693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conceptscorner.blogspot.com/2010/03/what-are-delegates.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default/5913196409967410693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2032195248484634804/posts/default/5913196409967410693'/><link rel='alternate' type='text/html' href='http://conceptscorner.blogspot.com/2010/03/what-are-delegates.html' title='What are delegates??'/><author><name>Naresh Penneti&#39;s Blog</name><uri>http://www.blogger.com/profile/04709988981629671389</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8DPOyItkMPtsT9ZMCoS0gUr_g0S3HJYw2VGKjdwU5ukyNor0c_-KTlgijA40DN6cKnj8MXM7clUWtrkGPWvziBd2OXhgBiI0l6fvAKgh0ef1WTGWdkCnKr8uXdZzJIFg/s220/DSC01222.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-QLaWfTVFycHPhP96B6gDyXnPpceWNe99ei9FZZkDWBvqPNE-GMrnrifWnqxXhcPaWlAGOATpWMuUsv_UU5pO4Kxo5V66TR0EkMGS3ZgRLcp8qo6CBy5-kin3hcxxoiVP6pEYAJN1XMs/s72-c/delegate.JPG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>