<?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-1138451586645163661</id><updated>2025-02-05T10:31:26.463-05:00</updated><category term="C#"/><category term="asp.net"/><category term="vb.net"/><category term="crystal reports"/><category term=".net FAQ"/><category term="OOP/OOD FAQ"/><category term="SQL FAQ"/><category term="interview questions"/><category term="report"/><category term="reporting services"/><category term="ssrs"/><title type='text'>.NET Notes</title><subtitle type='html'>Notes on various things encountered while developing applications for .NET Framework</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-1057785503524666569</id><published>2012-03-31T10:13:00.001-04:00</published><updated>2012-04-19T12:54:51.029-04:00</updated><title type='text'>Formatting with String.Format and ToString</title><content type='html'>&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type=&quot;text/css&quot;&gt;
.csharpcode, .csharpcode pre
{
 font-size: small;
 color: black;
 font-family: Consolas, &quot;Courier New&quot;, Courier, Monospace;
 background-color: #ffffff;
 /*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

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

.csharpcode .str { color: #a31515; }

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

.csharpcode .preproc { color: #cc6633; }

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

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

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

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;
        &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Main()
        {
            &lt;span class=&quot;rem&quot;&gt;//&lt;/span&gt;
            &lt;span class=&quot;rem&quot;&gt;// Format a ratio as a percentage string.&lt;/span&gt;
            &lt;span class=&quot;rem&quot;&gt;// ... You must specify the percentage symbol in the format string.&lt;/span&gt;
            &lt;span class=&quot;rem&quot;&gt;// ... It will multiply the value by 100 for you.&lt;/span&gt;
            &lt;span class=&quot;rem&quot;&gt;//&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; ratio = 0.73;
            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; result = &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;string = {0:0.0%}&quot;&lt;/span&gt;,
                ratio);
            Console.WriteLine(result);

            &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; value = 123;
            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; a = &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;.Format(&lt;span class=&quot;str&quot;&gt;&quot;{0:0000}&quot;&lt;/span&gt;, value); &lt;span class=&quot;rem&quot;&gt;// Too complex&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; b = value.ToString(&lt;span class=&quot;str&quot;&gt;&quot;0000&quot;&lt;/span&gt;); &lt;span class=&quot;rem&quot;&gt;// Simpler&lt;/span&gt;
            Console.WriteLine(a);
            Console.WriteLine(b);

            &lt;span class=&quot;rem&quot;&gt;// Format as currency&lt;/span&gt;
            &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; expense = 1234.56;
            &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; str = expense.ToString(&lt;span class=&quot;str&quot;&gt;&quot;C&quot;&lt;/span&gt;);
            Console.WriteLine(&lt;span class=&quot;str&quot;&gt;&quot;Expense: {0}&quot;&lt;/span&gt;, str);

            &lt;span class=&quot;rem&quot;&gt;// Format with parentheses&lt;/span&gt;
            str = String.Format(&lt;span class=&quot;str&quot;&gt;&quot;{0:(#####0.000)}&quot;&lt;/span&gt;, expense);
            Console.WriteLine(&lt;span class=&quot;str&quot;&gt;&quot;Expense: {0}&quot;&lt;/span&gt;, str);
        }&lt;/pre&gt;

Output:&lt;br /&gt;
string = 73.0% &lt;br /&gt;
0123&lt;br /&gt;
0123&lt;br /&gt;
Expense: $1,234.56&lt;br /&gt;
Expense: (1234.560)

&lt;p&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx&quot; target=&quot;_blank&quot;&gt;Standard Numeric Format Strings&lt;/a&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/1057785503524666569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/1057785503524666569' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/1057785503524666569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/1057785503524666569'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2012/03/formatting-with-stringformat-and.html' title='Formatting with String.Format and ToString'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-7279162777248907780</id><published>2011-06-23T17:24:00.000-04:00</published><updated>2011-06-23T17:24:20.138-04:00</updated><title type='text'>F# Code: Hindley Milner Type Inference Sample Implementatio...</title><content type='html'>&lt;a href=&quot;http://fsharpcode.blogspot.com/2010/08/hindley-milner-type-inference-sample.html?spref=bl&quot;&gt;F# Code: Hindley Milner Type Inference Sample Implementatio...&lt;/a&gt;: &quot;// Learn more about F# at http://fsharp.net  // Hindley Milner Type Inference Sample Implementation  // ************************************...&quot;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/7279162777248907780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/7279162777248907780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7279162777248907780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7279162777248907780'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2011/06/f-code-hindley-milner-type-inference.html' title='F# Code: Hindley Milner Type Inference Sample Implementatio...'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-6671670859850870822</id><published>2011-04-08T23:39:00.000-04:00</published><updated>2011-04-08T23:39:11.026-04:00</updated><title type='text'>.NET 4.0</title><content type='html'>&lt;a href=&quot;http://msdn.microsoft.com/en-us/vcsharp/bb798022.aspx?wt.slv=TopSectionSee&quot;&gt;http://msdn.microsoft.com/en-us/vcsharp/bb798022.aspx?wt.slv=TopSectionSee&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;.NET Framework 4.0&lt;/h2&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx&quot;&gt;Introduction to Membership&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/6e9y4s5t.aspx&quot;&gt;Configuring an ASP.NET Application to Use Membership&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/t32yf0a9.aspx&quot;&gt;Walkthrough: Managing Web Site Users with Roles&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/2fx93s7w.aspx&quot;&gt;Creating and Configuring the Application Services Database for SQL Server&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms164596.aspx&quot;&gt;Roles and Views in the Application Services Database for SQL Server&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/6671670859850870822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/6671670859850870822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/6671670859850870822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/6671670859850870822'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2011/04/net-40.html' title='.NET 4.0'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-7346823017155066894</id><published>2011-01-25T17:24:00.001-05:00</published><updated>2011-01-26T11:23:49.626-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="report"/><category scheme="http://www.blogger.com/atom/ns#" term="reporting services"/><category scheme="http://www.blogger.com/atom/ns#" term="ssrs"/><title type='text'>SQL Server Reporting Services</title><content type='html'>In this post, I will be talking about SQL Server Reporting Services (SSRS) 2008. Before I start discussing SSRS, I should mention that most of my reports development experience was with Crystal Reports, so I will compare SSRS features to those of Crystal Reports from time to time.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Overview &amp;amp; Features&lt;/strong&gt;&lt;br /&gt;
SSRS&amp;nbsp;Toolbox provides the following controls: Textbox, Line, Table, Matrix, Rectangle, List, Image, Subreport, Chart, Gauge. The most frequently used controls are the Textbox and Table.&lt;br /&gt;
&lt;br /&gt;
Textbox -- can be used as both, a textbox and a label (if you make it readonly).&lt;br /&gt;
Table -- used for displaying data in a tabular format. It has Header Row and Detail Row, which is nice, because I can use just a Table in SSRS where I would have to use a subreport in Crystal Reports.&lt;br /&gt;
&lt;br /&gt;
SSRS provides a powerful expressions engine based on Visual Basic syntax, a capabilty to add some vb.net code, and it also allows to add a&amp;nbsp;reference to a dll. Also, there are&amp;nbsp;quite a few&amp;nbsp;built-in functions, similar to those in Crystal Reports. Although, if you have a Crystal Reports background and are switching to SSRS reports, some things will require getting used to. For example, to display current page number you would&amp;nbsp;need to place a textbox control in the report&#39;s footer, go into expressions for that textbox&amp;nbsp;and code it there instead of just dragging and dropping as it is done in Crystal Reports. This is what the expression for something like &quot;&lt;strong&gt;Page 2 of 5&lt;/strong&gt;&quot; would look like:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;=&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Page &quot;&lt;/span&gt;&lt;/span&gt; &amp;amp; Globals!PageNumber &amp;amp; &lt;span style=&quot;color: #a31515;&quot;&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot; of &quot;&lt;/span&gt;&lt;/span&gt; &amp;amp; Globals!TotalPages&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;﻿&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;SSRS Development&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;To develop SSRS, you need to have BIDS (Business Intelligence Development Studio) installed. It can be part of SQL Server 2008 install.&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;Once you have it, you can create a couple of different types of projects: &lt;span style=&quot;color: #134f5c;&quot;&gt;Report Server Project&lt;/span&gt; and &lt;span style=&quot;color: #134f5c;&quot;&gt;Report Server Project Wizard&lt;/span&gt;. My preference is the Report Server Project, because it allows for more customization.&lt;/div&gt;&lt;br /&gt;
Before you begin designing and developing a new SSRS report, you have to create a DataSource. If you are planning to use this datasource in more than one report, make it shared.&lt;br /&gt;
&lt;br /&gt;
Once you are done creating a datasource, you will have to create a dataset that you will use with the report. Here is the confusing part: you can&#39;t create a dataset without having a report, so you have to add a report to your project first&amp;nbsp;and then create a dataset based on the datasource you created earlier. When creating a dataset, SSRS allows you to either type your SQL into a text field or you can choose&amp;nbsp;the option&amp;nbsp;to&amp;nbsp;enter a stored procedure name. I personally prefer using stored procedures, since they allow to do much more than a plain SQL statement.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s create a simple report consisting of a table and a header. The header will contain the report name and will be placed in the header of the report; the data will be displayed in a table and will be placed in the body of the report. In order to do that, we&#39;ll drag a textbox control&amp;nbsp;from the toolbox and position it within the header section and type a name for the report in it; then, we&#39;ll drag a table control from the toolbox and put it in the body section of the report. Once that&#39;s done, let&#39;s specify what data will be displayed in each table column. Assume that we are displaying customer info from Northwind database, we&#39;ll have 3 columns: First Name, Last Name, and Phone Number.&lt;br /&gt;
&lt;br /&gt;
The table control will display little buttons in each table column for you to choose what data will be feeding this column, such as First Name, Last Name, or Phone Number in our case. Let&#39;s display First Name in the first column, Last Name in the second column, and Phone Number in the third column, and give those columns appropriate headings. Now the report is ready and you can run it by clicking the Preview tab. Optionally, you may add a page number in the footer&amp;nbsp;and a date of last execution of the report in the header.&lt;br /&gt;
&lt;br /&gt;
To display the execution date and time, simply add a textbox to the report that will display this information, right-click on the textbox and choose Expressions; in the expression text area enter the following code:&lt;br /&gt;
&lt;br /&gt;
= Globals!ExecutionTime&lt;br /&gt;
&lt;br /&gt;
This will display the date and time when the report was last executed in a General Date format (something like &lt;span style=&quot;color: #073763; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;1/26/2011 11:15:05 AM&lt;span style=&quot;color: black; font-family: Times, &amp;quot;Times New Roman&amp;quot;, serif; font-size: small;&quot;&gt;).&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/7346823017155066894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/7346823017155066894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7346823017155066894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7346823017155066894'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2011/01/sql-server-reporting-services.html' title='SQL Server Reporting Services'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-7183859691453467218</id><published>2010-11-15T22:22:00.000-05:00</published><updated>2011-01-25T17:29:50.583-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="vb.net"/><title type='text'>String Manipulation in .NET</title><content type='html'>&lt;p&gt;String is one of the most frequently used data types in programming. There are quite a few string functions out there and all of those functions are implemented differently in different programming languages. I am going to show here how this is done in .NET Framework.   &lt;br /&gt;In the example below I am going to demonstrate the use of StringBuilder class. The below example receives a string as a parameter and then reverses it:    &lt;br /&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;private string&lt;/span&gt; ReverseString(&lt;span style=&quot;color: #4bacc6&quot;&gt;String&lt;/span&gt; str)       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;if&lt;/span&gt; (str != &lt;span style=&quot;color: blue&quot;&gt;string&lt;/span&gt;.Empty)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #4bacc6&quot;&gt;StringBuilder&lt;/span&gt; sb = &lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6&quot;&gt;StringBuilder&lt;/span&gt;();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &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 = str.Length - 1; i &amp;gt;= 0; i--)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sb.Append(str.Substring(i, 1));       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; str = sb.ToString();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: blue&quot;&gt;return&lt;/span&gt; str;       &lt;br /&gt;}      &lt;hr /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;     &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7c960b2e-0ea1-46f2-9077-5f19a4ce4021&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/.NET&quot; rel=&quot;tag&quot;&gt;.NET&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/C%23&quot; rel=&quot;tag&quot;&gt;C#&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/StringBuilder&quot; rel=&quot;tag&quot;&gt;StringBuilder&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/String+Manipulation&quot; rel=&quot;tag&quot;&gt;String Manipulation&lt;/a&gt;&lt;/div&gt;      &lt;br /&gt;Here is another example that accepts a string, splits it, and then reverses the order of words in that string:&lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;&lt;span style=&quot;color: blue&quot;&gt;private void&lt;/span&gt;&lt;/span&gt; ReOrderString()       &lt;br /&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;string str = &amp;quot;Token A#$%@&amp;amp;Token B#$%@&amp;amp;Token C#$%@&amp;amp;Token D#$%@&amp;amp;Token E&amp;quot;;&amp;#160; &lt;br /&gt;string[] Split = str.Split(&lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; string[] { &amp;quot;#$%@&amp;amp;&amp;quot; }, StringSplitOptions.None);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style=&quot;color: #4bacc6&quot;&gt;StringBuilder&lt;/span&gt; sb = &lt;span style=&quot;color: blue&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #4bacc6&quot;&gt;StringBuilder&lt;/span&gt;();         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &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 = Split.Length - 1; i &amp;gt;= 0; i--)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sb.Append(Split[i]);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (i &amp;gt; 0)         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sb.Append(&amp;quot;#$%@&amp;amp;&amp;quot;);         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; lblOriginalString.Text = &amp;quot;Token A#$%@&amp;amp;Token B#$%@&amp;amp;Token C#$%@&amp;amp;Token D#$%@&amp;amp;Token E&amp;quot;;         &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; lblProcessedString.Text = sb.ToString();         &lt;br /&gt;}         &lt;br /&gt;&lt;/span&gt;      &lt;br /&gt;&lt;/p&gt; &lt;/blockquote&gt; &lt;span style=&quot;font-family: &amp;#39;Courier New&amp;#39;&quot;&gt;&lt;/span&gt;  </content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/7183859691453467218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/7183859691453467218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7183859691453467218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7183859691453467218'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2010/11/string-manipulation-in-net.html' title='String Manipulation in .NET'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-6548763891514785296</id><published>2010-07-14T12:40:00.024-04:00</published><updated>2011-11-30T14:08:27.693-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".net FAQ"/><category scheme="http://www.blogger.com/atom/ns#" term="interview questions"/><category scheme="http://www.blogger.com/atom/ns#" term="OOP/OOD FAQ"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL FAQ"/><title type='text'>Technical Interview: Frequently Asked Questions &amp;amp; Answers</title><content type='html'>Most of the time, when applying for software development jobs, be prepared to answer the following questions: &lt;br /&gt;
1. General Programming Questions:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;What is the difference between passing parameter by value versus passing it by reference? &lt;/li&gt;
&lt;li&gt;What is boxing / unboxing? &lt;/li&gt;
&lt;li&gt;What is implicit conversion? &lt;/li&gt;
&lt;li&gt;What is explicit conversion? &lt;/li&gt;
&lt;li&gt;Late Binding vs. Early Binding in VB.NET&lt;/li&gt;
&lt;/ol&gt;&lt;a href=&quot;#oo&quot;&gt;2. OO Questions:&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;What are the main concepts of Object Oriented development? &lt;/li&gt;
&lt;li&gt;What is an Abstract Class? &lt;/li&gt;
&lt;li&gt;What is an Interface? &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms173183(VS.80).aspx&quot; target=&quot;_blank&quot;&gt;What is Reflection?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;What design patterns do you know? &lt;/li&gt;
&lt;li&gt;What is the difference between value types vs. reference types? &lt;/li&gt;
&lt;/ol&gt;&lt;a href=&quot;#sql&quot;&gt;3. SQL Questions:&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;How do you join two tables (SQL)? &lt;/li&gt;
&lt;li&gt;What are the differences between different types of join? &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#union&quot;&gt;What is UNION?&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;a href=&quot;#html&quot;&gt;4. HTML Questions:&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;How do you make a table cell that runs across several columns? &lt;/li&gt;
&lt;li&gt;How do you make a table cell that spans across multiple rows? &lt;/li&gt;
&lt;/ol&gt;&lt;strong&gt;OO Answers:&lt;/strong&gt; &lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; &lt;span style=&quot;color: blue;&quot;&gt;Object-oriented programming (OOP)&lt;/span&gt; is a programming paradigm that uses &quot;objects&quot; – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction, encapsulation, modularity, polymorphism, and inheritance. &lt;br /&gt;
&lt;br /&gt;
&lt;a name=&quot;oo&quot;&gt;&lt;strong&gt;2.&lt;/strong&gt;&lt;/a&gt; &lt;span style=&quot;color: blue;&quot;&gt;Abstract classes&lt;/span&gt; are closely related to interfaces. They are classes that cannot be instantiated, and are frequently either partially implemented, or not at all implemented. One key difference between abstract classes and interfaces is that a class may implement an unlimited number of interfaces, but may inherit from only one abstract (or any other kind of) class. A class that is derived from an abstract class may still implement interfaces. Abstract classes are useful when creating components because they allow you specify an invariant level of functionality in some methods, but leave the implementation of other methods until a specific implementation of that class is needed. They also version well, because if additional functionality is needed in derived classes, it can be added to the base class without breaking code. &lt;br /&gt;
&lt;br /&gt;
An abstract class is denoted in Visual Basic by the keyword MustInherit. In C#, the abstract modifier is used. Any methods that are meant to be invariant may be coded into the base class, but any methods that are to be implemented are marked in Visual Basic with the MustOverride modifier. In C#, the methods are marked abstract. The following example shows an abstract class: &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;&#39; Visual Basic&lt;/span&gt; &lt;br /&gt;
Public MustInherit Class WashingMachine &lt;br /&gt;
&lt;br /&gt;
Sub New() &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&#39; Code to instantiate the class goes here.&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
End sub &lt;br /&gt;
&lt;br /&gt;
Public MustOverride Sub Wash &lt;br /&gt;
Public MustOverride Sub Rinse (loadSize as Integer) &lt;br /&gt;
Public MustOverride Function Spin (speed as Integer) as Long &lt;br /&gt;
&lt;br /&gt;
End Class &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #6aa84f;&quot;&gt;// C#&lt;/span&gt; &lt;br /&gt;
abstract class WashingMachine &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public WashingMachine() &lt;br /&gt;
&amp;nbsp;&amp;nbsp; { &lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Code to initialize the class goes here.&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; abstract public void Wash(); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; abstract public void Rinse(int loadSize); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; abstract public long Spin(int speed); &lt;br /&gt;
} &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
In the above example, an abstract class is declared with one implemented method and three unimplemented methods. A class inheriting from this class would have to implement the Wash, Rinse, and Spin methods. The following example shows what the implementation of this class might look like: &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&#39; Visual Basic&lt;/span&gt; &lt;br /&gt;
Public Class MyWashingMachine &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;&amp;nbsp; Inherits WashingMachine &lt;br /&gt;
&lt;br /&gt;
Public Overrides Sub Wash() &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; Wash code goes here&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
End Sub &lt;br /&gt;
&lt;br /&gt;
Public Overrides Sub Rinse (loadSize as Integer) &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&#39; Rinse code goes here&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
End Sub &lt;br /&gt;
&lt;br /&gt;
Public Overrides Function Spin (speed as Integer) as Long &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&#39; Spin code goes here&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
End Sub &lt;br /&gt;
&lt;br /&gt;
End Class &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;// C#&lt;/span&gt; &lt;br /&gt;
class MyWashingMachine : WashingMachine &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public MyWashingMachine() &lt;br /&gt;
&amp;nbsp;&amp;nbsp; { &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;// Initialization code goes here. &lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; override public void Wash() &lt;br /&gt;
&amp;nbsp;&amp;nbsp; { &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #38761d;&quot;&gt;// Wash code goes here.&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; override public void Rinse(int loadSize) &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; &lt;span style=&quot;color: #38761d;&quot;&gt;// Rinse code goes here.&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; override public long Spin(int speed) &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; &lt;span style=&quot;color: #38761d;&quot;&gt;// Spin code goes here.&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
} &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
When implementing an abstract class, you must implement each abstract (MustOverride) method in that class, and each implemented method must receive the same number and type of arguments, and have the same return value, as the method specified in the abstract class. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3.&lt;/strong&gt; &lt;span style=&quot;color: blue;&quot;&gt;An interface&lt;/span&gt; contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface, as shown in the following example: &lt;br /&gt;
&lt;br /&gt;
interface ISampleInterface &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void SampleMethod(); &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
class ImplementationClass : ISampleInterface &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Explicit interface member implementation: &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; void ISampleInterface.SampleMethod() &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; // Method implementation. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main() &lt;br /&gt;
&amp;nbsp;&amp;nbsp; { &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Declare an interface instance. &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ISampleInterface obj = new ImplementationClass(); &lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Call the member. &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obj.SampleMethod(); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
} &lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-family: Georgia;&quot;&gt;&lt;span style=&quot;color: #333333;&quot;&gt;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;Remarks&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;An interface can be a member of a namespace or a class and can contain signatures of the following members: &lt;br /&gt;
•Methods &lt;br /&gt;
•Properties &lt;br /&gt;
•Indexers &lt;br /&gt;
•Events &lt;br /&gt;
&lt;span style=&quot;color: #333333; font-family: Georgia; font-size: xx-small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;An interface can inherit from one or more base interfaces. &lt;br /&gt;
When a base type list contains a base class and interfaces, the base class must come first in the list. &lt;br /&gt;
&lt;br /&gt;
A class that implements an interface can explicitly implement members of that interface. An explicitly implemented member cannot be accessed through a class instance, but only through an instance of the interface, for example: &lt;br /&gt;
&lt;br /&gt;
For more details and code examples on explicit interface implementation, see Explicit Interface Implementation (C# Programming Guide). &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Example&lt;/strong&gt; &lt;br /&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&amp;nbsp;&lt;/span&gt;The following example demonstrates interface implementation. In this example, the interface IPoint contains the property declaration, which is responsible for setting and getting the values of the fields. The class Point contains the property implementation. &lt;br /&gt;
&lt;br /&gt;
// keyword_interface_2.cs &lt;br /&gt;
// Interface implementation &lt;br /&gt;
using System; &lt;br /&gt;
&lt;br /&gt;
interface IPoint &lt;br /&gt;
{ &lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;// Property signatures:&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int x { get; set; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; int y { get; set; } &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
class Point : IPoint &lt;br /&gt;
{ &lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Fields:&lt;/span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private int _x; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private int _y; &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #274e13;&quot;&gt;// Constructor:&lt;/span&gt; &lt;br /&gt;
public Point(int x, int y) &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; _x = x; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; _y = y; &lt;br /&gt;
} &lt;br /&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;// Property implementation:&lt;/span&gt; &lt;br /&gt;
public int x &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; get &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; return _x; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; set &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; _x = value; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
public int y &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; get &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; return _y; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
set &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; _y = value; &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; } &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
class MainClass &lt;br /&gt;
{ &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; static void PrintPoint(IPoint p) &lt;br /&gt;
&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; Console.WriteLine(&quot;x={0}, y={1}&quot;, p.x, p.y); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; static void Main() &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; Point p = new Point(2, 3); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.Write(&quot;My Point: &quot;); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintPoint(p); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;4.&lt;/strong&gt; &lt;span style=&quot;color: blue;&quot;&gt;Design Patterns&lt;/span&gt;: check this MSDN&amp;nbsp; resource: &lt;a href=&quot;http://msdn.microsoft.com/en-us/magazine/cc301852.aspx&quot;&gt;http://msdn.microsoft.com/en-us/magazine/cc301852.aspx&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;br /&gt;
&lt;a name=&quot;sql&quot;&gt;&lt;strong&gt;SQL Answers:&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;1 &amp;amp; 2&lt;/strong&gt;&lt;strong&gt;.&lt;/strong&gt; &lt;span style=&quot;color: blue;&quot;&gt;SQL joins&lt;/span&gt; are used to query data from two or more tables, based on a relationship between certain columns in these tables. Different SQL JOINs: &lt;br /&gt;
•&lt;span style=&quot;color: blue;&quot;&gt;JOIN&lt;/span&gt;: Return rows when there is at least one match in both tables &lt;br /&gt;
•&lt;span style=&quot;color: blue;&quot;&gt;LEFT JOIN&lt;/span&gt;: Return all rows from the left table, even if there are no matches in the right table &lt;br /&gt;
•&lt;span style=&quot;color: blue;&quot;&gt;RIGHT JOIN&lt;/span&gt;: Return all rows from the right table, even if there are no matches in the left table &lt;br /&gt;
•&lt;span style=&quot;color: blue;&quot;&gt;FULL JOIN&lt;/span&gt;: Return rows when there is a match in one of the tables &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;SQL INNER JOIN Keyword&lt;/span&gt;&lt;br /&gt;
The INNER JOIN keyword return rows when there is at least one match in both tables.&lt;br /&gt;
&lt;div&gt;&lt;/div&gt;&lt;strong&gt;SQL INNER JOIN Syntax&lt;/strong&gt; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; column_name(s) &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; table_name1 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;INNER JOIN&lt;/span&gt; table_name2 &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; table_name1.column_name = table_name2.column_name &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;SQL LEFT JOIN Keyword&lt;/span&gt; &lt;br /&gt;
The LEFT JOIN keyword returns all rows from the left table (table_name1), even if there are no matches in the right table (table_name2). &lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;&lt;strong&gt;SQL LEFT JOIN Syntax&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; column_name(s) &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; table_name1 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;LEFT JOIN&lt;/span&gt; table_name2 &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; table_name1.column_name=table_name2.column_name &lt;br /&gt;
&lt;br /&gt;
PS: In some databases &lt;span style=&quot;color: blue;&quot;&gt;LEFT JOIN&lt;/span&gt; is called &lt;span style=&quot;color: blue;&quot;&gt;&lt;strong&gt;LEFT OUTER JOIN&lt;/strong&gt;&lt;/span&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;SQL RIGHT JOIN Keyword&lt;/span&gt; &lt;br /&gt;
The &lt;span style=&quot;color: blue;&quot;&gt;RIGHT JOIN&lt;/span&gt; keyword Return all rows from the right table (table_name2), even if there are no matches in the left table (table_name1). &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SQL RIGHT JOIN Syntax&lt;/strong&gt; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; column_name(s) &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; table_name1 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;RIGHT JOIN&lt;/span&gt; table_name2 &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; table_name1.column_name = table_name2.column_name &lt;br /&gt;
&lt;br /&gt;
PS: In some databases &lt;span style=&quot;color: blue;&quot;&gt;RIGHT JOIN&lt;/span&gt; is called &lt;span style=&quot;color: blue;&quot;&gt;&lt;strong&gt;RIGHT OUTER JOIN&lt;/strong&gt;&lt;/span&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;SQL FULL JOIN Keyword&lt;/span&gt; &lt;br /&gt;
The &lt;span style=&quot;color: blue;&quot;&gt;FULL JOIN&lt;/span&gt; keyword return rows when there is a match in one of the tables. &lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SQL FULL JOIN Syntax&lt;/strong&gt; &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; column_name(s) &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; table_name1 &lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;FULL JOIN&lt;/span&gt; table_name2 &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; table_name1.column_name = table_name2.column_name &lt;br /&gt;
&lt;br /&gt;
&lt;a name=&quot;union&quot;&gt;&lt;strong&gt;3.&lt;/strong&gt; UNION&lt;/a&gt;&lt;br /&gt;
The UNION operator is used to combine the result-set of two or more SELECT statements.&lt;br /&gt;
&lt;br /&gt;
Notice that each SELECT statement within the UNION must have the same number of columns. The columns must also have similar data types. Also, the columns in each SELECT statement must be in the same order.&lt;br /&gt;
&lt;br /&gt;
Note: The UNION operator selects only distinct values by default. To allow duplicate values, use UNION ALL.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SQL UNION Syntax&lt;/strong&gt;&lt;br /&gt;
SELECT column_name(s) FROM table_name1&lt;br /&gt;
UNION&lt;br /&gt;
SELECT column_name(s) FROM table_name2&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;SQL UNION ALL Syntax&lt;/strong&gt;&lt;br /&gt;
SELECT column_name(s) FROM table_name1&lt;br /&gt;
UNION ALL&lt;br /&gt;
SELECT column_name(s) FROM table_name2&lt;br /&gt;
&lt;br /&gt;
Note: The column names in the result-set of a UNION are always equal to the column names in the first SELECT statement in the UNION.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/6548763891514785296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/6548763891514785296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/6548763891514785296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/6548763891514785296'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2010/07/technical-interview-frequently-asked.html' title='Technical Interview: Frequently Asked Questions &amp;amp; Answers'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-2626938710138214351</id><published>2010-04-15T11:57:00.000-04:00</published><updated>2010-04-15T11:57:01.429-04:00</updated><title type='text'>SQL Server Keyboard Shortcuts</title><content type='html'>&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms174205.aspx&quot;&gt;SQL Server Keyboard Shortcuts from Microsoft&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.technoreader.com/SQL-Server-2005-keyboard-shortcuts.aspx&quot;&gt;SQL Server 2005 Query Analyzer shortcuts&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/2626938710138214351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/2626938710138214351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/2626938710138214351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/2626938710138214351'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2010/04/sql-server-keyboard-shortcuts.html' title='SQL Server Keyboard Shortcuts'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-7961641293111765047</id><published>2010-04-14T14:36:00.056-04:00</published><updated>2010-04-26T12:33:04.475-04:00</updated><title type='text'>Visual Studio 2008 Cheet Sheet</title><content type='html'>The other day I searched for a keyboard shortcut reference for Visual Studio 2008. After I saw the list of all the different shortcuts, I compiled a list of Visual Studio 2008 keyboard shortcuts for tasks that I use most frequently:&lt;br /&gt;
&lt;br /&gt;
&lt;table border=0&gt;&lt;tr&gt;
&lt;td&gt;F5&lt;/td&gt;&lt;td&gt;Start your project in debug mode&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F7 &amp;amp; Shift-F7&lt;/td&gt;&lt;td&gt;Show the code windows &amp;amp; show the designer window&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Alt-Enter or F4&lt;/td&gt;&lt;td&gt;Show the properties panel for a selected object&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;F6 / Shift-F6 / Ctrl-Shift-B&lt;/td&gt;
&lt;td&gt;Build Solution / Build Project / Build Solution&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Shift-Alt-C&lt;/td&gt;&lt;td&gt;Add a new class to the project&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-Shift-A / Alt-Shift-A&lt;/td&gt;&lt;td&gt;Add a new item to your project / add an existing item to your project&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-K + Ctrl-C&lt;/td&gt;&lt;td&gt;Comment a selected block of code&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-K + Ctrl-U&lt;/td&gt;&lt;td&gt;Uncomment a selected block of code&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-M + Ctrl-O / &lt;br/&gt;Ctrl-M + Ctrl-P&lt;/td&gt;
&lt;td&gt;Collapse all code to definitions / Expand all code (stop collapsing)&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-K + Ctrl-K&lt;/td&gt;&lt;td&gt;Toggle code bookmark&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-K + Ctrl-N&lt;/td&gt;&lt;td&gt;Go to next bookmark&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Ctrl-K + Ctrl-P&lt;/td&gt;&lt;td&gt;Go to previous bookmark&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td&gt;Ctrl-Shift-Tab&lt;/td&gt;&lt;td&gt;Scroll backwards through open windows&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;F9&lt;/td&gt;
&lt;td&gt;Set or remove a breakpoint&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;F12&lt;/td&gt;
&lt;td&gt;Go to definition&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;Shift-F12&lt;/td&gt;
&lt;td&gt;Display all references&lt;/td&gt;
&lt;/tr&gt;


&lt;/table&gt;&lt;br /&gt;
Below are some of the VS2008 Keyboard Shortcuts Cheat Sheets that originally came up in my search:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://nerdfortress.s3.amazonaws.com/visual-studio-2008-keyboard-shortcuts.html&quot;&gt;Cheat Sheet with Key Images&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://dotnetspidor.blogspot.com/2009/06/22-visual-studio-short-keys-and-6-short.html&quot;&gt;22 Visual Studio Short Keys and 6 Short-cut Ways to Custom Jobs: A List of Tips and Tricks&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.microsoft.com/downloads/details.aspx?familyid=E5F902A8-5BB5-4CC6-907E-472809749973&amp;displaylang=en&quot;&gt;Visual C# 2008 Keybinding Reference Poster&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/7961641293111765047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/7961641293111765047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7961641293111765047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7961641293111765047'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2010/04/visual-studio-2008-cheet-sheet.html' title='Visual Studio 2008 Cheet Sheet'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-6314632137676947509</id><published>2010-01-14T22:39:00.011-05:00</published><updated>2011-01-25T17:29:50.584-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="vb.net"/><title type='text'>ASP.NET AJAX Date Picker</title><content type='html'>&lt;p&gt;&amp;#160;&amp;#160;&amp;#160; Recently, while working on my Tai Chi club’s website, I realized that my club’s website is lacking the capability of scheduling a Tai Chi class (or any other type of event for that matter). In order to schedule any type of event, I would need to specify that event’s date and time, location, and maybe some kind of description or explanation of what’s going to be happening during that event. So, I started looking at different ways to create a Date Picker. After some research, I found out that it is very easily achieved with &lt;a href=&quot;http://www.asp.net/ajax/downloads/&quot; target=&quot;_blank&quot;&gt;Ajax Control Toolkit&lt;/a&gt;, which provides CalendarExtender control.&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; The CalendarExtender control is designed to extend a TextBox. Its default behavior prompts the end user to pick a date from a calendar when the user clicks inside a textbox associated with the CalendarExtender.   &lt;br /&gt;    &lt;br /&gt;This is what it looks like:    &lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDXeMvo8kQrF20jppc7ZAXwWBaZ1eOPTM5Vr8bMFXbYDpwiW5L8-E2dwfZxkqBbqYm2dTlXI9PDnaitpfAYVdI38j-ig5IzfN1Skkpg03NP_ZXlunDZTSbYqXoXWZu_eilT9bWCRoP9kFo/s1600-h/screenshot01+Jan.+14+23.04.gif&quot;&gt;&lt;img style=&quot;margin: 0px 10px 10px 0px; width: 226px; float: left; height: 248px; cursor: hand&quot; id=&quot;BLOGGER_PHOTO_ID_5426813239401080770&quot; border=&quot;0&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDXeMvo8kQrF20jppc7ZAXwWBaZ1eOPTM5Vr8bMFXbYDpwiW5L8-E2dwfZxkqBbqYm2dTlXI9PDnaitpfAYVdI38j-ig5IzfN1Skkpg03NP_ZXlunDZTSbYqXoXWZu_eilT9bWCRoP9kFo/s320/screenshot01+Jan.+14+23.04.gif&quot; /&gt;&lt;/a&gt;It is also possible to add a button to the right of the textbox and have the calendar popup whenever the user clicks that button (all you need to do is specify the button&#39;s ID as value of PopupButtonID property).    &lt;br /&gt;    &lt;br /&gt;To customize the look of the popup calendar, add all or some of the following classes to your stylesheet and customize them appropriately:&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;To achieve the look above, I added the following class to my stylesheet:&lt;/p&gt;  &lt;p&gt;&lt;font color=&quot;#400000&quot;&gt;.ajax__calendar_active&lt;/font&gt;    &lt;br /&gt;{    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;font color=&quot;#ff0000&quot;&gt;border&lt;/font&gt;:&lt;font color=&quot;#000040&quot;&gt; solid 2px green&lt;/font&gt;;    &lt;br /&gt;&amp;#160;&amp;#160; &lt;font color=&quot;#ff0000&quot;&gt; font-weight&lt;/font&gt;: &lt;font color=&quot;#000040&quot;&gt;bold&lt;/font&gt;;    &lt;br /&gt;}&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;and then in my page’s Page_Load event added the following line of code:&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;&lt;font color=&quot;#000080&quot;&gt;this&lt;/font&gt;.&lt;font color=&quot;#000000&quot;&gt;CalendarExtender1.SelectedDate =&lt;/font&gt; &lt;font color=&quot;#0080c0&quot;&gt;DateTime&lt;/font&gt;.&lt;font color=&quot;#000000&quot;&gt;Today;&lt;/font&gt;&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_container&lt;/font&gt;    &lt;br /&gt;you can change the style of outer container of calendar control. Outer container holds the .ajax__calendar_header, .ajax__calendar_body, .ajax__calendar_footer as child container css classes.    &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_header&lt;/font&gt;    &lt;br /&gt;This css class holds the previous arrow, next arrow and current Month, Year. Child Css Classes are .ajax__calendar_prev, .ajax__calendar_next, .ajax__calendar_title.    &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_prev&lt;/font&gt;    &lt;br /&gt;This class is associated with an element that displays the left side arrow to view the previous month, year or decade based on the current view of calendar.    &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_title&lt;/font&gt;    &lt;br /&gt;This class is associated with an element that displays the month name, year or decade range according to the current view of the calendar control.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_next&lt;/font&gt;    &lt;br /&gt;This class is associated with an element that displays the right side arrow to view the next month, year or decade based on the current view of calendar.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_body&lt;/font&gt;    &lt;br /&gt;It is a container of the elements for displaying the different views of calendar such as month view, year view and day view. This class holds the .ajax__calendar_days, .ajax__calendar_months and .ajax__calendar_years as child css classes     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_days&lt;/font&gt;    &lt;br /&gt;It changes the look of day view of month. Child Css Classes are .ajax__calendar_dayname and .ajax__calendar_day.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_dayname&lt;/font&gt;    &lt;br /&gt;It changes the look of day name at the top of day view of month.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_day&lt;/font&gt;    &lt;br /&gt;This class is associated with the day layout of month.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_months&lt;/font&gt;    &lt;br /&gt;It controls the month layout of month view. Child Css class is .ajax__calendar_month.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_month&lt;/font&gt;    &lt;br /&gt;It controls the look and feel of month names of month view.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_years&lt;/font&gt;    &lt;br /&gt;This class controls the layout of year view of calendar control. Child css class: .ajax__calendar_year.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_year&lt;/font&gt;    &lt;br /&gt;It changes the look and feel of years in the year layout of year view.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_footer&lt;/font&gt;    &lt;br /&gt;It is associated with Footer container that holds the current date.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_today&lt;/font&gt;    &lt;br /&gt;It displays the current date in the footer container of calendar control.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_hover&lt;/font&gt;    &lt;br /&gt;Dynamic color behavior onmouseover can be modified by using this class. It can be used with .ajax__calendar_title, .ajax__calendar_day, .ajax__calendar_month, .ajax__calendar_year, .ajax__calendar_today to change the mouse over behavior.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_active&lt;/font&gt;    &lt;br /&gt;It sets the style of currently selected date.     &lt;br /&gt;    &lt;br /&gt;&lt;font color=&quot;#000080&quot;&gt;.ajax__calendar_other&lt;/font&gt;    &lt;br /&gt;It sets the style of day, month name or year that is outside the current view e.g. days that don’t belong to the currently visible month.&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/6314632137676947509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/6314632137676947509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/6314632137676947509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/6314632137676947509'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2010/01/aspnet-ajax-date-picker.html' title='ASP.NET AJAX Date Picker'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDXeMvo8kQrF20jppc7ZAXwWBaZ1eOPTM5Vr8bMFXbYDpwiW5L8-E2dwfZxkqBbqYm2dTlXI9PDnaitpfAYVdI38j-ig5IzfN1Skkpg03NP_ZXlunDZTSbYqXoXWZu_eilT9bWCRoP9kFo/s72-c/screenshot01+Jan.+14+23.04.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-5626961930136533746</id><published>2009-02-18T09:52:00.003-05:00</published><updated>2011-01-25T17:30:55.014-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crystal reports"/><title type='text'>Passing Parameter to a Subreport</title><content type='html'>A few days ago I was revising my application and made some modifications. One of the modifications were that now all of my subreports required an additional parameter, which was not required for the main report. The &lt;span style=&quot;font-weight:bold; font-size: 8pt; color: navy;&quot;&gt;SetParameterValue(parameterName, parameterValue)&lt;/span&gt; method did not work, because it only works with main report object and can&#39;t be used with subreports. So, this is what I did to make it work:&lt;br /&gt;&lt;br /&gt;1. I included additional parameters in the main report and then linked them to their corresponding counterparts in my subreports. &lt;br /&gt;&lt;br /&gt;2. After that was done, I only had to pass their values to the main report using the &lt;span style=&quot;font-weight:bold; font-size: 8pt; color: navy;&quot;&gt;SetParameterValue(parameterName, parameterValue)&lt;/span&gt; method. &lt;br /&gt;&lt;br /&gt;Everything worked after I did that, which was a big relief for me, considering my deadlines :)</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/5626961930136533746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/5626961930136533746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/5626961930136533746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/5626961930136533746'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2009/02/passing-parameter-to-subreport.html' title='Passing Parameter to a Subreport'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-1400010776544558965</id><published>2008-08-05T14:32:00.014-04:00</published><updated>2011-01-25T17:30:55.014-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="crystal reports"/><title type='text'>Passing Parameter to Crystal Report</title><content type='html'>Recently, I was developing a pretty sophisticated Crystal Report that included multiple sub-reports and used multiple stored procedures as data sources. All of those stored procedures accepted the same parameter, which made my life a little easier, since I only had to deal with one parameter that I needed to pass to my Crystal Report.&lt;br /&gt;&lt;br /&gt;In order for all sub-reports to be able to recognize the parameter, which I am passing to the main report, I had to link all of my sub-reports to the main report using that parameter.&lt;br /&gt;&lt;br /&gt;In order to link a sub-report to the main report, the following actions should be performed:&lt;br /&gt;&lt;br /&gt;To link a subreport to the data in the primary report&lt;ol&gt;&lt;li value=&quot;1&quot;&gt;If you are creating a new subreport or importing an existing report  as a subreport, from the &lt;b class=&quot;desktop&quot;&gt;Insert &lt;/b&gt;menu, click &lt;b&gt;Subreport&lt;/b&gt;. Choose or create a report and click the &lt;b class=&quot;desktop&quot;&gt;Link &lt;/b&gt;tab.  &lt;p class=&quot;indent&quot;&gt;- or -&lt;/p&gt; &lt;p&gt;If you have already placed a subreport in the primary report,  but did not create a link at setup, navigate to the Subreport Links dialog box  by choosing &lt;b&gt;Subreport Links&lt;/b&gt; from the &lt;b&gt;Edit&lt;/b&gt; menu.&lt;/p&gt; &lt;p&gt;The Subreport Links dialog box appears.&lt;/p&gt; &lt;/li&gt;&lt;li value=&quot;2&quot;&gt;Choose the subreport you want to link from the &lt;b&gt;For  subreport&lt;/b&gt; list (if it is not already selected).  &lt;/li&gt;&lt;li value=&quot;3&quot;&gt;Select the field you want used as a link field in the primary  (containing) report from the &lt;b&gt;Available Fields&lt;/b&gt; list.  &lt;/li&gt;&lt;li value=&quot;4&quot;&gt;Click the &gt; arrow.  &lt;p&gt;The field is added to the &quot;Field(s) to link to&quot; list box, and is  now selected as a link field.&lt;/p&gt; &lt;/li&gt;&lt;li value=&quot;5&quot;&gt;Repeat steps 3 and 4 for each additional link, as desired.  &lt;/li&gt;&lt;li value=&quot;6&quot;&gt;Use the &lt;b&gt;Field link&lt;/b&gt; section (which will only  appear if you have selected a link field) to set up the link for each link  field:  &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Select the field you want linked to the primary report from the &quot;Subreport  parameter field to use.&quot;  &lt;/li&gt;&lt;li&gt;Select the &quot;Select data in subreport based on field&quot; check box on and select  a field from the adjacent drop&lt;nobr&gt;-d&lt;/nobr&gt;own list to organize the subreport  data based on a specific field (this is the quick equivalent of using the Select  Expert). If nothing is specified here, the subreport will adopt the organization  of the primary report. &lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li value=&quot;7&quot;&gt;Click &lt;b&gt;OK&lt;/b&gt;. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;When you run the report, the program will coordinate the  data in the primary report with the data in the subreport.&lt;/p&gt;&lt;br /&gt;Below is the code that I used to pass my parameter to the Crystal Report and then display it in PDF format to the end-user:&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Protected Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;As&lt;/span&gt; Object, &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;As&lt;/span&gt; System.EventArgs) Handles &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Me&lt;/span&gt;.Load&lt;br /&gt; &lt;blockquote&gt; GenerateReport(Session(&quot;EmpId&quot;))&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Private Sub&lt;/span&gt; GenerateReport(&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;ByVal&lt;/span&gt; EmpId &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;As&lt;/span&gt; Integer)&lt;br /&gt;  &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt; &lt;/span&gt;&lt;blockquote&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;Dim&lt;/span&gt; theReport &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;As New&lt;/span&gt; ReportDocument&lt;br /&gt;  theReport.FileName = &quot;C:\myProject\Reports\myReport.rpt&quot;&lt;br /&gt;  theReport.SetDatabaseLogon(PCON.APP.UserName, _&lt;br /&gt;                                                                PCON.APP.Pass, _&lt;br /&gt;                                                                PCON.APP.db_Server, _&lt;br /&gt;                                                                PCON.APP.dbName)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&#39;Set the required parameter for Crystal Report&lt;/span&gt;&lt;br /&gt;theReport.SetParameterValue(&quot;@Id&quot;, EmpId)&lt;br /&gt;&lt;br /&gt;  &lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&#39;Now, present report in PDF format&lt;/span&gt;&lt;br /&gt;  theReport.ExportToHttpResponse ( _&lt;br /&gt;                           &lt;blockquote&gt;ExportFormatType.PortableDocFormat, _&lt;br /&gt;                                                                                                        Response, _&lt;br /&gt;                                                                                                        &lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;False&lt;/span&gt;, _&lt;br /&gt;                           &quot;ExportedReport&quot;)&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;End Sub&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/1400010776544558965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/1400010776544558965' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/1400010776544558965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/1400010776544558965'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2008/08/passing-parameter-to-crystal-report.html' title='Passing Parameter to Crystal Report'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-4178668546354759193</id><published>2008-03-22T23:19:00.022-04:00</published><updated>2008-04-07T00:38:39.355-04:00</updated><title type='text'>Character Counter</title><content type='html'>&lt;p style=&quot;font-size:9pt;font-family: arial;&quot;&gt;Recently I was developing a webform (asp.net) where the user could submit his feedback, and one of the requirements was that the user should not enter more than a set number of characters in his message, so I thought it would be real nice for the end user to know how many more characters he still can type until the maximum limit is reached.&lt;br /&gt;&lt;br /&gt;In order to allow that functionality, I created a asp.net multiline textbox for text input and an html readonly text field (for displaying number of characters until the maximum).&lt;br /&gt;&lt;br /&gt;Then, I created a Javascript function and called it every time the contents of the multiline textbox changed (onKeyUp and onChange events).&lt;br /&gt;&lt;br /&gt;Below is the code:&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language=&quot;JavaScript&quot;&amp;gt;&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function CountChars(text,long)&lt;br /&gt;{&lt;br /&gt;   var maxlength = new Number(long);&lt;br /&gt;   var myLength = text.value.length;&lt;br /&gt;   document.forms[0].Counter.value = maxlength - myLength;&lt;br /&gt;   if (myLength &gt; maxlength){&lt;br /&gt;      text.value = text.value.substring(0,maxlength);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;p style=&quot;font-size:9pt;font-family: arial;&quot;&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;form id=&quot;Form1&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;asp:Textbox mode=&quot;multiline&quot; id=&quot;txtMessage&quot; runat=&quot;server&quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;input type=&quot;text&quot; name=&quot;Counter&quot; readonly=&quot;readonly&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br /&gt;            Util.SetTextBoxPropertiesFull(txtMessage, True)&lt;br /&gt;        End Sub&lt;br /&gt;&lt;br /&gt;and then, in the SetTextBoxPropertiesFull method I had the following two lines of code that did the work:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;txt.Attributes.Add(&quot;onKeyUp&quot;, &quot;CountChars(this,&quot; &amp;amp; txt.MaxLength &amp;amp; &quot;)&quot;) &lt;br /&gt;txt.Attributes.Add(&quot;onChange&quot;, &quot;CountChars(this,&quot; &amp;amp; txt.MaxLength &amp;amp; &quot;)&quot;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another handy code snippet is as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;txt.Attributes.Add(&quot;onfocus&quot;, &quot;this.className=&#39;myStyle1&#39;&quot;) &lt;br /&gt;txt.Attributes.Add(&quot;onblur&quot;, &quot;this.className=&#39;myStyle2&#39;&quot;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where myStyle1 and myStyle2 are names of css classes defined in the stylesheet.&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/4178668546354759193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/4178668546354759193' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/4178668546354759193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/4178668546354759193'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2008/03/character-counter.html' title='Character Counter'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-7613509619918404570</id><published>2007-03-29T13:02:00.000-04:00</published><updated>2011-01-25T17:29:50.584-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="vb.net"/><title type='text'>Converting ASP.NET to PDF</title><content type='html'>&lt;p style=&quot;TEXT-INDENT: 20px&quot;&gt;&lt;br /&gt;&lt;span style=&quot;size: 9pt;font-family:Arial;color:#000000;&quot;  &gt;I probably wouldn&#39;t be wrong if I said that most developers every now and then are tasked to present specific data contained in a webpage as a PDF document. There are two ways to do it:&lt;/span&gt; &lt;ol style=&quot;COLOR: #000000; FONT-FAMILY: Arial; size: 9pt&quot;&gt;&lt;li&gt;using the functionality of CrystalReportViewer&#39;s toolbar - this toolbar provides a button, which does exactly that. However, to use this approach you would have to actually display the crystal report on the page.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;programmatically convert the Crystal Report object into a PDF document using the Crystal Reports API&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;span style=&quot;size: 9pt;font-family:Arial;color:#000000;&quot;  &gt;Below is the code for the second approach:&lt;br /&gt;&lt;br /&gt;&lt;code   style=&quot;font-size:9pt;color:#555555;&quot;&gt;&lt;span style=&quot;color:#000099;&quot;&gt;Dim&lt;/span&gt; report &lt;span style=&quot;color:#000099;&quot;&gt;As&lt;/span&gt; CrystalReport1 = &lt;span style=&quot;color:#000099;&quot;&gt;New&lt;/span&gt; CrystalReport1&lt;br /&gt;SqlDataAdapter1.Fill(DataSet11)&lt;br /&gt;report.SetDataSource(DataSet11)&lt;br /&gt;report.ExportToHttpResponse _&lt;br /&gt;(ExportFormatType.PortableDocFormat, _&lt;br /&gt;Response, _&lt;br /&gt;False, _&lt;br /&gt;&quot;ExportedReport&quot;)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/7613509619918404570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/7613509619918404570' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7613509619918404570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/7613509619918404570'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2007/03/converting-aspnet-into-pdf.html' title='Converting ASP.NET to PDF'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1138451586645163661.post-8917295914188776379</id><published>2007-03-27T03:24:00.001-04:00</published><updated>2011-01-25T17:29:50.584-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="asp.net"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="vb.net"/><title type='text'>Crystal Reports with ASP.NET</title><content type='html'>&lt;p&gt;&lt;span style=&quot;font-family:arial;font-size:9pt;&quot;&gt;When it comes to developing a report for an ASP.NET application, one might find that there is very little information available on how it&#39;s done using Crystal Reports.&lt;br /&gt;&lt;br /&gt;Visual Studio 2003 comes with a built-in version of Crystal Reports (CR 9). Using that built-in version of Crystal Reports might save you some money, since it&#39;s a part of VS 2003, however, from the Crystal Reports design prospective it is much more convenient to use a stand-alone version of Crystal Reports.&lt;br /&gt;&lt;br /&gt;The latest version of Crystal Reports at the time of writing this post is Crystal Reports XI, which provides some new features, not available in previous versions (see the &lt;a href=&quot;http://www.businessobjects.com/products/reporting/crystalreports/developer/default.asp&quot; target=&quot;_blank&quot;&gt;www.businessobjects.com&lt;/a&gt; website for more info), so in my last development I used that version of Crystal Reports.&lt;br /&gt;&lt;br /&gt;In order for the report to display as a webpage, VS 2003 provides CrystalReportViewer control. This is how it works:&lt;br /&gt;&lt;br /&gt;Instantiate the DataSet object&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span style=&quot;color:#000099;&quot;&gt;Dim&lt;/span&gt; ds &lt;span style=&quot;color:#000099;&quot;&gt;As New&lt;/span&gt; DataSet&lt;br /&gt;&lt;br /&gt;ds = GetDataForReport() &lt;span style=&quot;color:#006600;&quot;&gt;&#39;some method that retrieves data for the report&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Instantiate the ReportDocument object:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#000099;&quot;&gt;Dim&lt;/span&gt; rpt &lt;span style=&quot;color:#000099;&quot;&gt;As New&lt;/span&gt; ReportDocument&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006600;&quot;&gt;&#39;set the ReportObject as the report you want to display&lt;/span&gt;&lt;br /&gt;rpt = &lt;span style=&quot;color:#000099;&quot;&gt;New&lt;/span&gt; CrystalReport1&lt;br /&gt;&lt;span style=&quot;color:#006600;&quot;&gt;&#39;Define the datasource of your report&lt;/span&gt;&lt;br /&gt;rpt.SetDataSource(ds)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#006600;&quot;&gt;&#39;define your report as a reportsource for the crystalreportviewer&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;CrystalReportViewer1.ReportSource = rpt&lt;/strong&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Below is C# version of this code:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;DataSet ds = &lt;span style=&quot;color:#000099;&quot;&gt;new &lt;/span&gt;DataSet();&lt;br /&gt;ReportDocument rpt = &lt;span style=&quot;color:#000099;&quot;&gt;new &lt;/span&gt;ReportDocument();&lt;br /&gt;rpt = &lt;span style=&quot;color:#000099;&quot;&gt;new &lt;/span&gt;CrystalReport1();&lt;br /&gt;rpt.SetDataSource(ds);&lt;br /&gt;&lt;strong&gt;CrystalReportViewer1.ReportSource = rpt;&lt;/strong&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;In order for this code to work, the following namespaces must be imported/used:&lt;br /&gt;&lt;br /&gt;CrystalDecisions.CrystalReports.Engine&lt;br /&gt;CrystalDecisions.Shared&lt;br /&gt;CrystalDecisions.Web.Design&lt;br /&gt;&lt;br /&gt;The following namespaces should be used only if you are planning to &lt;strong&gt;convert&lt;/strong&gt; the report into a &lt;strong&gt;PDF, Word, or Excel&lt;/strong&gt; format.&lt;br /&gt;&lt;br /&gt;CrystalDecisions.Shared.ExportDestinationType&lt;br /&gt;CrystalDecisions.Shared.ExportFormatType&lt;br /&gt;CrystalDecisions.Shared.ExportDestinationOptions&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://gregoryblogging.blogspot.com/feeds/8917295914188776379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1138451586645163661/8917295914188776379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/8917295914188776379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1138451586645163661/posts/default/8917295914188776379'/><link rel='alternate' type='text/html' href='http://gregoryblogging.blogspot.com/2007/03/crystal-reports-with-aspnet.html' title='Crystal Reports with ASP.NET'/><author><name>Gregory Rubinstein</name><uri>http://www.blogger.com/profile/09162677334534753096</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8LU6rQP2mf5BWx0JwGMdv5_hLTrcrUOByNjb7KMYrdX7FGMImvfSddjdN4ESKzVJwrgbZrawLujbaHxmFtjGtkkmyoMuKQRJdqbrkfegakwe0t-SgiM8lqW4gjxHSRQ/s113/ProfilePhoto.png'/></author><thr:total>0</thr:total></entry></feed>