<?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-5021003743199290743</id><updated>2025-08-04T12:32:20.299-07:00</updated><category term="aspnet"/><category term="dotnet"/><category term="windows"/><category term="software"/><category term="design"/><category term="sql"/><category term="model"/><category term="programming"/><category term="vb.net"/><category term="javascript"/><category term="microsoft"/><category term="C/C++"/><category term="sdlc"/><category term="crm"/><category term="html5"/><category term="sql server"/><category term="tipsandtricks"/><category term="assembly"/><category term="html"/><category term="interrupts"/><category term="technology"/><category term="architecture"/><category term="crysral reports"/><category term="php"/><category term="visual studio"/><title type='text'>Software Works</title><subtitle type='html'>&quot;I have not failed. I&#39;ve just found 10,000 ways that won&#39;t work.&quot;&lt;br&gt;--Thomas Edison&lt;br&gt;&quot;Not everything that can be counted counts, and not everything that counts can be counted.&quot;&lt;br&gt;--Albert Einstein&lt;br&gt;&quot;If you can&#39;t make it good, at least make it look good.&quot;&lt;br&gt;&quot;Your most unhappy customers are your greatest source of learning.&quot;&lt;br&gt;--Bill Gates</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>116</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-2805909209239533040</id><published>2024-12-07T02:40:00.000-08:00</published><updated>2024-12-07T02:40:38.390-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>Dynamic Pivot with SQL in SQL Server</title><content type='html'>&lt;p&gt;&amp;nbsp;In our example we have a Dynamic Survey form in the database which we would use to take survey of employees across an agency. Now when we have collected the survey we need to generate a report in pivot format which would give u one row per employee and in the columns we would get answers to each question. Interesting!&lt;/p&gt;&lt;p&gt;Lets look at the options available in SQL Server.&lt;/p&gt;&lt;p&gt;To pivot your query and transform it into a format where each row represents an employee and the columns contain answers for each question, you can use a &lt;code&gt;PIVOT&lt;/code&gt; operation.&lt;/p&gt;&lt;h3&gt;Steps:&lt;/h3&gt;&lt;ol&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Aggregate the Data&lt;/strong&gt;:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Use the base query to gather the employee data, question texts, and their corresponding answers.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prepare the Pivot&lt;/strong&gt;:&lt;/p&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Use the &lt;code&gt;PIVOT&lt;/code&gt; operator to dynamically transform rows (questions and answers) into columns for each question.&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;div&gt;If the questions are dynamic and you don&#39;t know them in advance, you need to dynamically generate the column list using dynamic SQL.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;h3&gt;Handling Dynamic Questions:&lt;/h3&gt;&lt;p&gt;If the list of questions is not fixed and changes frequently, you can use &lt;strong&gt;dynamic SQL&lt;/strong&gt; to generate the column list automatically.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;
&lt;code&gt;&lt;pre&gt;DECLARE @Columns NVARCHAR(MAX);
DECLARE @SQL NVARCHAR(MAX);

-- Step 1: Generate the Column List Using FOR XML PATH
SELECT @Columns = STUFF((
    SELECT DISTINCT &#39;,&#39; + QUOTENAME(QUESTION)
    FROM QUIZ_QUESTIONS
    WHERE QUESTIONID IN (
        SELECT DISTINCT QUESTIONID
        FROM QUIZ_ATTEMPT_RESULT
        WHERE QUIZASSIGNID IN (SELECT QUIZASSIGNID FROM QUIZ_ASSIGNMENT WHERE QUIZID = 1)
    )
    FOR XML PATH(&#39;&#39;), TYPE).value(&#39;.&#39;, &#39;NVARCHAR(MAX)&#39;), 1, 1, &#39;&#39;);

-- Step 2: Construct the Dynamic Pivot Query
SET @SQL = &#39;
WITH BaseData AS (
    SELECT 
        EMPLOYEES.EMPLOYEEID,
        EMPLOYEES.FIRSTNAME + &#39;&#39; &#39;&#39; + EMPLOYEES.LASTNAME AS EmployeeName,
        QUIZ_QUESTIONS.QUESTION AS QuestionText,
        QUIZ_QUESTION_ANSWERS.ANSWER AS Answer
    FROM [dbo].[QUIZ_ASSIGNMENT]
    INNER JOIN EMPLOYEES
        ON EMPLOYEES.EMPLOYEEID = [QUIZ_ASSIGNMENT].EMPLOYEEID
    INNER JOIN [dbo].[QUIZ_ATTEMPT_RESULT]
        ON QUIZ_ATTEMPT_RESULT.QUIZASSIGNID = QUIZ_ASSIGNMENT.QUIZASSIGNID
    INNER JOIN [dbo].[QUIZ_QUESTION_ANSWERS]
        ON QUIZ_QUESTION_ANSWERS.ANSWERID = QUIZ_ATTEMPT_RESULT.ANSWERID
    INNER JOIN [dbo].[QUIZ_QUESTIONS]
        ON QUIZ_QUESTIONS.QUESTIONID = QUIZ_ATTEMPT_RESULT.QUESTIONID
    WHERE QUIZ_ASSIGNMENT.QUIZID = 1
)
SELECT *
FROM (
    SELECT 
        EmployeeName,
        QuestionText,
        Answer
    FROM BaseData
) AS SourceTable
PIVOT (
    MAX(Answer)
    FOR QuestionText IN (&#39; + @Columns + &#39;)
) AS PivotTable;
&#39;;

-- Step 3: Execute the Dynamic SQL
EXEC sp_executesql @SQL;
&lt;/pre&gt;&lt;/code&gt;

&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Sample Input Data:&lt;/h3&gt;

&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: left;&quot;&gt;Name&lt;/th&gt;&lt;th&gt;Question&lt;/th&gt;&lt;th&gt;Answer&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;John Smith&lt;/td&gt;&lt;td&gt;What is your name?&lt;/td&gt;&lt;td&gt;John&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;John Smith&lt;/td&gt;&lt;td&gt;What is your age?&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Jane Doe&lt;/td&gt;&lt;td&gt;What is your name?&lt;/td&gt;&lt;td&gt;Jane&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Jane Doe&lt;/td&gt;&lt;td&gt;What is your age?&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;

&lt;h3&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3&gt;Sample Output Data:&lt;/h3&gt;

&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th style=&quot;text-align: left;&quot;&gt;Name&lt;/th&gt;&lt;th&gt;What is your name?&lt;/th&gt;&lt;th&gt;What is your age?&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;John Smith&lt;/td&gt;&lt;td&gt;John&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Jane Doe&lt;/td&gt;&lt;td&gt;Jane&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/2805909209239533040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2024/12/dynamic-pivot-with-sql-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/2805909209239533040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/2805909209239533040'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2024/12/dynamic-pivot-with-sql-in-sql-server.html' title='Dynamic Pivot with SQL in SQL Server'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-2589036797177609847</id><published>2012-09-23T01:46:00.001-07:00</published><updated>2012-09-23T01:58:45.060-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>HTML5, Draw Rounded Rectangle on Canvas</title><content type='html'>Example below will draw rounded rectangle:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;function doRoundedRectangle(c,sx,sy,ex,ey,r) {
 var ctx = c.getContext(&quot;2d&quot;);
 var r2d = Math.PI/180;
 if( ( ex - sx ) - ( 2 * r ) &amp;lt; 0 ) { r = ( ( ex - sx ) / 2 ); } //ensure that the radius isn&#39;t too large for x
 if( ( ey - sy ) - ( 2 * r ) &amp;lt; 0 ) { r = ( ( ey - sy ) / 2 ); } //ensure that the radius isn&#39;t too large for y
 ctx.beginPath();
 ctx.moveTo(sx+r,sy);
 ctx.lineTo(ex-r,sy);
 ctx.arc(ex-r,sy+r,r,r2d*270,r2d*360,false);
 ctx.lineTo(ex,ey-r);
 ctx.arc(ex-r,ey-r,r,r2d*0,r2d*90,false);
 ctx.lineTo(sx+r,ey);
 ctx.arc(sx+r,ey-r,r,r2d*90,r2d*180,false);
 ctx.lineTo(sx,sy+r);
 ctx.arc(sx+r,sy+r,r,r2d*180,r2d*270,false);
 ctx.closePath();
};
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Parameters:&lt;/b&gt; &lt;br /&gt;
c = Canvas object&lt;br /&gt;
sx = Start x position&lt;br /&gt;
sy = Start y position&lt;br /&gt;
ex = End x position&lt;br /&gt;
ey = End y position&lt;br /&gt;
r = radius for rounded corners</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/2589036797177609847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2012/09/html5-draw-rounded-rectangle-on-canvas.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/2589036797177609847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/2589036797177609847'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2012/09/html5-draw-rounded-rectangle-on-canvas.html' title='HTML5, Draw Rounded Rectangle on Canvas'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-3003903702805443276</id><published>2012-03-13T00:01:00.006-07:00</published><updated>2012-03-13T00:17:19.325-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><title type='text'>HttpException: The URL-encoded form data is not valid</title><content type='html'>An httpexception might be poping up in most of the ASP.NET 2.0 applications where there are lot of user controls on your view. Microsoft security update MS11-100 limits the maximum number of form keys, files, and JSON members to 1000 in an HTTP request. Because of this change, ASP.NET applications reject requests that have more than 1000 of these elements.&lt;br /&gt;HTTP clients that make these kinds of requests will be denied, and an error message will appear in the web browser. The error message will usually have an HTTP 500 status code. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Exception information in Windows event log will contain: &lt;br /&gt;Exception type: HttpException &lt;br /&gt;Exception message: The URL-encoded form data is not valid&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ASP.NET 2.0&lt;/strong&gt;&lt;br /&gt;If your application view reaches over 1000 elements, than you will need to configure this value in your web.config file. And following lines need to be added:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;appSettings&amp;gt;&lt;br /&gt;    &amp;lt;add key=&quot;aspnet:MaxHttpCollectionKeys&quot; value=&quot;1000&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/appSettings&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You should set the value to your need, and it should be any value over 1000. You can give value under 1000 as well if your application works on it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ASP.NET 1.1&lt;/strong&gt;&lt;br /&gt;For .NET 1.1 web applications you will have to set a DWORD in registry. Following is the key:&lt;br /&gt;&lt;br /&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\1.1.4322.0\MaxHttpCollectionKeys&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;JSON Limit&lt;/strong&gt;&lt;br /&gt;Applications that hit this limit for JSON payloads can configure as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;appSettings&amp;gt;&lt;br /&gt;    &amp;lt;add key=&quot;aspnet:MaxJsonDeserializerMembers&quot; value=&quot;1000&quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/appSettings&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Reference:&lt;br /&gt;&lt;a href=&quot;http://support.microsoft.com/kb/2661403&quot;&gt;http://support.microsoft.com/kb/2661403&lt;/a&gt;&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/3003903702805443276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2012/03/httpexception-url-encoded-form-data-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/3003903702805443276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/3003903702805443276'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2012/03/httpexception-url-encoded-form-data-is.html' title='HttpException: The URL-encoded form data is not valid'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-6574897875999289322</id><published>2012-01-11T01:19:00.000-08:00</published><updated>2012-01-11T01:28:07.528-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="software"/><title type='text'>Commodo Antivirus, Manually update virus definition</title><content type='html'>&lt;strong&gt;Download the latest full AV database:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;For respective CIS version, we have different complete bases.cav:&lt;br /&gt;&lt;br /&gt;1. For CIS 4.x&lt;br /&gt;Following link points to latest complete bases.cav always&lt;br /&gt;http://download.Comodo.com/av/updates40/sigs/bases/bases.cav&lt;br /&gt;&lt;br /&gt;2. For CIS 5.0&lt;br /&gt;Following link points to latest complete bases.cav always&lt;br /&gt;http://download.Comodo.com/av/updates50/sigs/bases/bases.cav&lt;br /&gt;&lt;br /&gt;3. For CIS 5.3 &amp; 5.4&lt;br /&gt;i) Download&lt;br /&gt;http://download.Comodo.com/av/updates51/sigs/bases/bases.cav.z&lt;br /&gt;ii)&lt;br /&gt;Use 7-zip from http://www.7-zip.org/download.html , or your archiver program of choice that can handle 7z archives and unpack it. After unpacking you will have to rename the file to bases.cav.&lt;br /&gt;&lt;br /&gt;4. For CIS 5.5&lt;br /&gt;i) Download&lt;br /&gt;http://download.Comodo.com/av/updates55/sigs/bases/bases.cav.z&lt;br /&gt;ii)&lt;br /&gt;Use 7-zip from http://www.7-zip.org/download.html , or your archiver program of choice that can handle 7z archives and unpack it. After unpacking you will have to rename the file to bases.cav.&lt;br /&gt;&lt;br /&gt;5. For CIS 5.8&lt;br /&gt;i) Download&lt;br /&gt;http://download.Comodo.com/av/updates58/sigs/bases/bases.cav.z&lt;br /&gt;ii)&lt;br /&gt;Use 7-zip from http://www.7-zip.org/download.html , or your archiver program of choice that can handle 7z archives and unpack it. After unpacking you will have to rename the file to bases.cav.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Activating the download:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. Save the downloaded file on your computer&lt;br /&gt;&lt;br /&gt;2. Reboot in Safe-Mode&lt;br /&gt;&lt;br /&gt;3. Open explorer and go to C:\Program files\Comodo\Comodo internet security\scanners and copy the downloaded bases.cav here&lt;br /&gt;&lt;br /&gt;4. Reboot your system in normal mode</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/6574897875999289322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2012/01/commodo-antivirus-manually-update-virus.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6574897875999289322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6574897875999289322'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2012/01/commodo-antivirus-manually-update-virus.html' title='Commodo Antivirus, Manually update virus definition'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-4103788558247563201</id><published>2011-11-17T21:20:00.000-08:00</published><updated>2011-11-17T21:31:19.585-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>The &#39;microsoft.jet.oledb.4.0&#39; provider is not registered on the local machine</title><content type='html'>On Windows 7 64bit and Windows 2008 64bit system a common error may arise when using Microsoft.jet.oledb.4.0 driver. Applications running in 64bit mode may not be able to access this driver. This is because 64bit version of this driver does not exist.&lt;br /&gt;&lt;br /&gt;Solution to this problem is as follows:&lt;br /&gt;&lt;br /&gt;1. We use 32bit application, 32bit application will be able to access the ODBC drivers&lt;br /&gt;&lt;br /&gt;2. If you are a application developer and need to develop a 64bit application which can connect to csv, excel files, etc using ADO.NET. You should use Microsoft Access Database Engine 2010 which is a small redistributable and available in both 32bit and 64bit versions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Summary:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Issue:&lt;br /&gt;The &#39;microsoft.jet.oledb.4.0&#39; provider is not registered on the local machine.&lt;br /&gt;Issue is that Application pool is running in 64bit mode, therefore 32bit Jet drivers not accessible.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;Microsoft Access Database Engine 2010:&lt;br /&gt;http://www.microsoft.com/download/en/details.aspx?id=13255&lt;br /&gt;Use this provider Microsoft.ACE.OLEDB.12.0 to connect with csv, excel, etc files.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/4103788558247563201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/11/microsoftjetoledb40-provider-is-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4103788558247563201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4103788558247563201'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/11/microsoftjetoledb40-provider-is-not.html' title='The &#39;microsoft.jet.oledb.4.0&#39; provider is not registered on the local machine'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-5773290146202419145</id><published>2011-09-21T01:56:00.000-07:00</published><updated>2011-12-14T23:40:35.206-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><category scheme="http://www.blogger.com/atom/ns#" term="dotnet"/><category scheme="http://www.blogger.com/atom/ns#" term="vb.net"/><title type='text'>How to sort Rows/Data in a DataTable</title><content type='html'>We can sort binding source, data view and data table default view to sort data in a data table. There are following three methods which can be applied:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Method 1:&lt;br /&gt; bindingSource.DataSource = table&lt;br /&gt; dataGridView.DataSource = bindingSource&lt;br /&gt; bindingSource.Sort = &quot;Column_Name&quot;&lt;br /&gt;&lt;br /&gt;Method 2:&lt;br /&gt;Alternatively, you can just use a DataView:&lt;br /&gt;&lt;br /&gt; Dim view as DataView = new DataView(table)&lt;br /&gt; view.Sort = &quot;Column_Name&quot;&lt;br /&gt; dataGridView.DataSource = view&lt;br /&gt;&lt;br /&gt;Method 3:&lt;br /&gt;or change the DataTable&#39;s DefaultView:&lt;br /&gt;&lt;br /&gt; table.DefaultView.Sort = &quot;Column_Name&quot;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Column_Name is the name of one or more columns on which a sort is required. So a Column_Name can have following values like: &quot;COUNTRY&quot; or &quot;COUNTRY, POPULATION&quot; or &quot;COUNTRY, POPULATION DESC&quot;.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/5773290146202419145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/09/how-to-sort-rowsdata-in-datatable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/5773290146202419145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/5773290146202419145'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/09/how-to-sort-rowsdata-in-datatable.html' title='How to sort Rows/Data in a DataTable'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-2208592626573226864</id><published>2011-04-08T20:42:00.000-07:00</published><updated>2011-04-08T23:29:59.944-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>SQL Server Management, error 29506</title><content type='html'>When installing SQL Server Management studio on Windows 7 64bit it gives an error with error code 29506. The problem is we need to start this setup as Administrator. Unfortunately when we right click on the setup file, there is no option to Run as Administrator in the context menu.&lt;br /&gt;&lt;br /&gt;A work around to this problem is we start a Command prompt (Console) as Administrator, set directory path to the location of setup file, and type the setup file name and press enter to execute.&lt;br /&gt;&lt;br /&gt;Now the setup will start as Administrator and will successfully complete.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;br /&gt;1. Downloaded setup file SQLServer2005_SSMSEE_x64.msi from Microsoft and saved on my local disk, in my case it is D:\Softwares\SSMSEE\&lt;br /&gt;&lt;br /&gt;2. Open start menu and type &quot;cmd&quot; in the search box, you will see &quot;cmd.exe&quot; program&lt;br /&gt;&lt;br /&gt;3. Now right click it and select Run as Administrator&lt;br /&gt;&lt;br /&gt;4. First change drive by typing D: and press enter&lt;br /&gt;&lt;br /&gt;5. Now change directory to setup location, type &quot;cd D:\Softwares\SSMSEE\&quot; and press enter&lt;br /&gt;&lt;br /&gt;6. Now type setup file name &quot;SQLServer2005_SSMSEE_x64.msi&quot; and press enter&lt;br /&gt;&lt;br /&gt;7. The setup will start and complete successfully. That&#39;s all&lt;br /&gt;&lt;br /&gt;This might also be the case with Windows 7 with 32bit version, in that case same solution should work.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/2208592626573226864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/04/sql-server-management-error-29506.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/2208592626573226864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/2208592626573226864'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/04/sql-server-management-error-29506.html' title='SQL Server Management, error 29506'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-8839531252711707450</id><published>2011-01-05T23:43:00.000-08:00</published><updated>2011-12-15T00:25:16.245-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><title type='text'>A canvas globalCompositeOperation example</title><content type='html'>&lt;p&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjPHxsfCuVXIkFc-eaLbNEC3KZfK7mmx49YwQ7G8GyrBxMyn0EWG5ou-t7XRvNTcrgl4YQYXDeiHFQ2iy1GVWCmH4qI2iFZGwUs8QVNrVqbb9-uNptX08FsH9DbiMaJCyZbLSFYcaWyaz9/s1600/globalCompositeOperation.gif&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;width: 320px; height: 278px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjPHxsfCuVXIkFc-eaLbNEC3KZfK7mmx49YwQ7G8GyrBxMyn0EWG5ou-t7XRvNTcrgl4YQYXDeiHFQ2iy1GVWCmH4qI2iFZGwUs8QVNrVqbb9-uNptX08FsH9DbiMaJCyZbLSFYcaWyaz9/s320/globalCompositeOperation.gif&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5686258872461133970&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;var compositeTypes = [&lt;br /&gt;  &#39;source-over&#39;,&#39;source-in&#39;,&#39;source-out&#39;,&#39;source-atop&#39;,&lt;br /&gt;  &#39;destination-over&#39;,&#39;destination-in&#39;,&#39;destination-out&#39;,&lt;br /&gt;  &#39;destination-atop&#39;,&#39;lighter&#39;,&#39;darker&#39;,&#39;copy&#39;,&#39;xor&#39;&lt;br /&gt;];&lt;br /&gt;function draw(){&lt;br /&gt;  for (i=0;i&amp;lt;compositeTypes.length;i++){&lt;br /&gt;    var label = document.createTextNode(compositeTypes[i]);&lt;br /&gt;    document.getElementById(&#39;lab&#39;+i).appendChild(label);&lt;br /&gt;    var ctx = document.getElementById(&#39;tut&#39;+i).getContext(&#39;2d&#39;);&lt;br /&gt;&lt;br /&gt;    // draw rectangle&lt;br /&gt;    ctx.fillStyle = &quot;#09f&quot;;&lt;br /&gt;    ctx.fillRect(15,15,70,70);&lt;br /&gt;&lt;br /&gt;    // set composite property&lt;br /&gt;    ctx.globalCompositeOperation = compositeTypes[i];&lt;br /&gt;    &lt;br /&gt;    // draw circle&lt;br /&gt;    ctx.fillStyle = &quot;#f30&quot;;&lt;br /&gt;    ctx.beginPath();&lt;br /&gt;    ctx.arc(75,75,35,0,Math.PI*2,true);&lt;br /&gt;    ctx.fill();&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;/p&gt;&lt;br /&gt;&lt;i&gt;Reference: &lt;a href=&quot;https://developer.mozilla.org/samples/canvas-tutorial/6_1_canvas_composite.html&quot; target=&quot;_blank&quot;&gt;developer.mozilla.org/samples/canvas-tutorial/canvas_composite&lt;/a&gt;&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/8839531252711707450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/01/canvas-globalcompositeoperation-example.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/8839531252711707450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/8839531252711707450'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/01/canvas-globalcompositeoperation-example.html' title='A canvas globalCompositeOperation example'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjPHxsfCuVXIkFc-eaLbNEC3KZfK7mmx49YwQ7G8GyrBxMyn0EWG5ou-t7XRvNTcrgl4YQYXDeiHFQ2iy1GVWCmH4qI2iFZGwUs8QVNrVqbb9-uNptX08FsH9DbiMaJCyZbLSFYcaWyaz9/s72-c/globalCompositeOperation.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-404544186306341395</id><published>2011-01-02T09:44:00.000-08:00</published><updated>2011-06-13T21:45:32.389-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><title type='text'>Check if a browser supports HTML5</title><content type='html'>Check if a browser supports HTML5&lt;br /&gt;&lt;br /&gt;HTML5 is a new way of developing interactive websites, HTML5 is still a emerging technology but we can already see lot of work being done and browsers supporting this new technology.&lt;br /&gt;&lt;br /&gt;Anyone who will develop HTML5 will need to know how he can detect the browser is capable of supporting HTML5? or How he can detect which features the browser is compatible with.&lt;br /&gt;&lt;br /&gt;The simplest way to do that is creating a canvas object using &lt;code&gt;document.createElement&lt;/code&gt; method. After creating the object we can check if 2D context can be created, here is an example below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;function supports_canvas() {&lt;br /&gt; //Check if browser supports canvas&lt;br /&gt; return !!document.createElement(&#39;canvas&#39;).getContext;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;We have a open source solution as well, with help of which we can all the features supported by a browser, this is a javascript include file which can be obtained from &lt;a href=&quot;http://www.modernizr.com/&quot;&gt;Modernizr&lt;/a&gt;. We simply need to include this file in the head section, no call to any function, on its include it executes and initialize few boolean properties which can be accessed to check different HTML5 feature support.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;  &amp;lt;meta charset=&quot;utf-8&quot;&amp;gt;&lt;br /&gt;  &amp;lt;title&amp;gt;Dive Into HTML5&amp;lt;/title&amp;gt;&lt;br /&gt;  &amp;lt;script src=&quot;modernizr.min.js&quot;&amp;gt;&amp;lt;/script&amp;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;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;&lt;br /&gt;The Modernizr.canvas property will return false if your browser does not support the HTML5 canvas API, following check will be used:&lt;br /&gt;&lt;pre&gt;if (Modernizr.canvas) {&lt;br /&gt;  // let&#39;s perform some 2d graphics!&lt;br /&gt;} else {&lt;br /&gt;  // no canvas support available!&lt;br /&gt;}&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/404544186306341395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/01/check-if-browser-supports-html5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/404544186306341395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/404544186306341395'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/01/check-if-browser-supports-html5.html' title='Check if a browser supports HTML5'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-8752755438801245708</id><published>2011-01-01T02:57:00.000-08:00</published><updated>2011-06-19T07:46:37.061-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="html5"/><title type='text'>HTML5 Hello World Application</title><content type='html'>I consider HTML5 canvas the backbone of all the features available in HTML5, i recently got chance to work on a HTML5 application and really enjoyed learning new things and was really impressed with myself. Actually anyone who already knows some JavaScript and traditional HTML can kick start working on it.&lt;br /&gt;&lt;br /&gt;For those who have just started working on it, i have created a Hello world application, this is a simple application, but will give overall view of how it works. Like in our graduation we always create a Hello world application to get start learning things, so here how it works:&lt;br /&gt;&lt;br /&gt;First of all we should know whether the browser supports HTML5 canvas, for this you can view my post at &lt;a href=&quot;http://software-works.blogspot.com/2011/01/check-if-browser-supports-html5.html&quot;&gt;Check if browser supports HTML&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I will use following method:&lt;br /&gt;&lt;pre&gt;function supports_canvas() {&lt;br /&gt; //Check if browser supports canvas&lt;br /&gt; return !!document.createElement(&#39;canvas&#39;).getContext;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Next we need a Canvas element which supports 2D graphic drawings, it is the canvas on which we can draw different shapes like circle, rectangle, arcs, circle, etc also we can write text, and draw images from some source files.&lt;br /&gt;&lt;br /&gt;This sample focuses on creating a canvas and writing hello world on it. For this i will create a DIV element in my document, than add a Canvas element in the DIV using JavaScript:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function initializeCanvas(containerid, canvasWidth, canvasHeight) {&lt;br /&gt;  var container = document.getElementById(containerid);&lt;br /&gt;  if ( supports_canvas() ) {&lt;br /&gt;    //Create canvas element&lt;br /&gt;    var canvas = document.createElement(&#39;canvas&#39;);&lt;br /&gt;    canvas.setAttribute(&#39;width&#39;, canvasWidth);&lt;br /&gt;    canvas.setAttribute(&#39;height&#39;, canvasHeight);&lt;br /&gt;    container.appendChild(canvas);&lt;br /&gt;    //Context of canvas for performing 2d graphics operations&lt;br /&gt;    context = canvas.getContext(&#39;2d&#39;);&lt;br /&gt;    return context;&lt;br /&gt;  } else {&lt;br /&gt;    container.innerHTML = &#39;This is a HTML5 app,&lt;br /&gt;    you need a HTML5 capable browser like Firefox,&lt;br /&gt;    Chrome, Safari or Internet Explorer 9.&#39;&lt;br /&gt;    &lt;br /&gt;    return null;&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is the working sample: &lt;a href=&quot;http://software-works.blogspot.com/p/html5-hello-world-application-sample.html&quot;&gt;Sample Hello World&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/8752755438801245708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/01/html5-hello-world-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/8752755438801245708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/8752755438801245708'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/01/html5-hello-world-application.html' title='HTML5 Hello World Application'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-4754601647847673899</id><published>2010-12-31T22:14:00.000-08:00</published><updated>2011-12-15T00:23:44.337-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><category scheme="http://www.blogger.com/atom/ns#" term="crysral reports"/><title type='text'>Crystal Reports .NET Error: Load Report Failed</title><content type='html'>Most of the ASP.NET developers might be familiar with this problem and faced it too. When we Google for it, most of the solutions indicate that the C:\Windows\Temp folder needs permission for NETWORK SERVICE account in Windows Server and ASP NET account in Windows Client.&lt;br /&gt;&lt;br /&gt;On my web server i can clearly see temporary files of crystal reports being created when a report is called from ASP.NET page. It is recommended to set a special permission no C:\Windows\Temp folder as follows:&lt;br /&gt;&lt;br /&gt;Add permission to List folder and Read&lt;br /&gt;Add permission to Create files, Append files&lt;br /&gt;Add permission to Delete files&lt;br /&gt;&lt;br /&gt;This should fix the problem in 80% of the cases. Although there are other scenarios as well which cause this problem. But i have here indicated the one common problem, i hope it works for most of you and save you a day.&lt;br /&gt;&lt;br /&gt;Another issue might be in the coding section, if report documents are not properly closed and disposed off, this will trigger the error as well. Whenever a report is called in a web application a copy in C:\Windows\Temp folder is created and than served to the client response.&lt;br /&gt;&lt;br /&gt;You should inspect the C:\Windows\Temp folder to see if these temp files are not hanging around, if so that means the report documents are not properly close and disposed after processing. Crystal report document need to be closed by calling the Close() method and than the Dispose() method to clean.&lt;br /&gt;&lt;br /&gt;There is a recommendation for this in SAP Crystal reports document, and the code should look similar to the following:&lt;br /&gt;&lt;pre&gt;private void Page_Unload(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;  if (boReportDocument != null)&lt;br /&gt;  {&lt;br /&gt;    boReportDocument.Close();&lt;br /&gt;    boReportDocument.Dispose();&lt;br /&gt;    GC.Collect();&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Reference: &lt;a href=&quot;https://docs.google.com/open?id=0B8raVW8TE4WrZmFhMWQzMDQtM2E3My00M2E0LWEwN2MtYmJlYTE5YTBhMTQ1&quot; target=&quot;_blank&quot;&gt;Troubleshooting the “Load Report Failed” Error&lt;/a&gt;&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/4754601647847673899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/12/crystal-reports-net-error-load-report.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4754601647847673899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4754601647847673899'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/12/crystal-reports-net-error-load-report.html' title='Crystal Reports .NET Error: Load Report Failed'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-4412981966905398188</id><published>2010-12-31T04:15:00.000-08:00</published><updated>2011-11-18T04:21:46.568-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>SQL Database Snapshot</title><content type='html'>&lt;span style=&quot;font-weight:bold;&quot;&gt;Create Database Snapshot on Current database:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;USE TEST&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;DECLARE @name VARCHAR(1000),&lt;br /&gt;  @filename VARCHAR(1000),&lt;br /&gt;  @dbname VARCHAR(1000),&lt;br /&gt;  @dbssname VARCHAR(1000),&lt;br /&gt;  @dbssfilename VARCHAR(1000)&lt;br /&gt;&lt;br /&gt;DECLARE @hour VARCHAR(2),&lt;br /&gt;  @minute VARCHAR(2)&lt;br /&gt;&lt;br /&gt;SET @hour = DATENAME(HOUR,GETDATE())&lt;br /&gt;IF LEN(@hour) = 1 SET @hour = &#39;0&#39;+@hour&lt;br /&gt;SET @minute = DATENAME(MINUTE,GETDATE())&lt;br /&gt;IF LEN(@minute) = 1 SET @minute = &#39;0&#39;+@minute&lt;br /&gt;&lt;br /&gt;SET @dbname = Db_Name();&lt;br /&gt;SET @dbssname = @dbname+&#39;_data_&#39;+@hour+@minute&lt;br /&gt;SET @dbssfilename = &#39;C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Data\&#39;+@dbssname+&#39;.ss&#39;&lt;br /&gt;&lt;br /&gt;SELECT @name = [name], @filename = [filename]&lt;br /&gt;FROM sys.sysfiles&lt;br /&gt;WHERE groupid = 1;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--CREATE SNAPSHOT&lt;br /&gt;EXEC( &#39;CREATE DATABASE &#39; + @dbname + &#39;_dbss&#39; +@hour+@minute + &#39; ON&lt;br /&gt;( NAME =&#39; + @name + &#39;, FILENAME = &#39;&#39;&#39;+@dbssfilename +&#39;&#39;&#39;)&lt;br /&gt;AS SNAPSHOT OF &#39;+@dbname);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Restore Database to a Database Snapshot:&lt;/span&gt;&lt;br /&gt;USE master;&lt;br /&gt;GO&lt;br /&gt;-- Reverting TEST to TEST_dbss1717&lt;br /&gt;RESTORE DATABASE TEST from &lt;br /&gt;DATABASE_SNAPSHOT = &#39;TEST_dbss1717&#39;;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Drop Database Snapshot:&lt;/span&gt;&lt;br /&gt;USE master;&lt;br /&gt;GO&lt;br /&gt;DROP DATABASE TEST_dbss1717;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/4412981966905398188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/12/sql-database-snapshot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4412981966905398188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4412981966905398188'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/12/sql-database-snapshot.html' title='SQL Database Snapshot'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-6168728077327154477</id><published>2010-11-26T03:09:00.000-08:00</published><updated>2010-12-26T03:18:46.436-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><title type='text'>ASP.NET Change Master page on Run time</title><content type='html'>As in my earlier post we looked at how we can change Theme of a page on click of a button, this similar principle is applied when we try to change master page on click of a button.&lt;br /&gt;&lt;br /&gt;We again have the same question:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Can in Change master page on button click?&lt;/b&gt;&lt;br /&gt;&lt;b&gt;How to change master page on click of button?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The answer is again simple after reading the documentation of System.Web.UI.Page.MasterPageFile() property:&lt;br /&gt;&lt;br /&gt;Property: Public Overridable Property MasterPageFile() As String&lt;br /&gt;Member of: System.Web.UI.Page&lt;br /&gt;Summary: Gets or sets the file name of the master page.&lt;br /&gt;Exceptions:&lt;br /&gt;System.InvalidOperationException: The System.Web.UI.Page.MasterPageFile&lt;br /&gt;property is set after the System.Web.UI.Page.PreInit event is complete.&lt;br /&gt;System.Web.HttpException: The file specified in does not exist or The page does not have a System.Web.UI.WebControls.Content control as the top level control.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The &#39;MasterPageFile&#39; property can only be set in or before the &#39;Page_PreInit&#39; event.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Same work around to change the MasterPageFile on run time on click of a button:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Partial Class Default&lt;br /&gt;    Inherits System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;    Protected Sub btnChange_Click(ByVal sender As Object, _&lt;br /&gt;        ByVal e As System.EventArgs) Handles btnChange.Click&lt;br /&gt;        &#39;Cannot change MasterPageFile on Click event&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Protected Sub Page_PreInit(ByVal sender As Object, _&lt;br /&gt;            ByVal e As System.EventArgs) Handles Me.PreInit&lt;br /&gt;        &#39;If Page is postback&lt;br /&gt;        If Me.IsPostBack = True Then&lt;br /&gt;            If Not Request(btnChange.UniqueID) Is Nothing Then&lt;br /&gt;                Me.MasterPageFile = &quot;~/NewMasterpage.master&quot;&lt;br /&gt;            End If&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;End Class&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We have changed the MasterPageFile in &#39;Page_PreInit&#39; event but on click of a button.&lt;br /&gt;&lt;br /&gt;UniqueID of a control gets the unique, hierarchically qualified identifier for the server control. The fully qualified identifier for the server control, this is the ID which is received as key when value is post back.&lt;br /&gt;&lt;br /&gt;The output of button is like this:&lt;br /&gt;&amp;lt;input type=&quot;submit&quot; name=&quot;btnChange&quot; value=&quot;Change Theme&quot; id=&quot;btnChange&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;Here name is what we call btnChange.UniqueID and id is what we call btnChane.ClientID, in HTML input controls &quot;id&quot; is used for client side validation and other java script things, and &quot;name&quot; attribute is used to identify the field when it is post back to server.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/6168728077327154477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-change-master-page-on-run-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6168728077327154477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6168728077327154477'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-change-master-page-on-run-time.html' title='ASP.NET Change Master page on Run time'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-5895859365592561723</id><published>2010-11-23T08:59:00.000-08:00</published><updated>2010-12-26T03:20:51.184-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><title type='text'>ASP.NET Change Page Theme on Run time</title><content type='html'>A simple question about setting themes in ASP.NET would be of in which event I can set the or change the Theme of my page. Like if i want to give an option for user to select from list of available themes and the site on run time could be changed to a specific theme.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Can in Change theme on button click?&lt;/b&gt;&lt;br /&gt;&lt;b&gt;How to change theme on click of button?&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The answer was simple after reading the documentation of System.Web.UI.Page.Theme() property:&lt;br /&gt;&lt;br /&gt;Property: Public Overridable Property Theme() As String&lt;br /&gt;Member of: System.Web.UI.Page&lt;br /&gt;Summary: Gets or sets the name of the page theme.&lt;br /&gt;Exceptions:&lt;br /&gt;System.InvalidOperationException: An attempt was made to set System.Web.UI.Page.Theme after the System.Web.UI.Page.PreInit event has occurred.&lt;br /&gt;System.ArgumentException: System.Web.UI.Page.Theme is set to an invalid theme name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The &#39;Theme&#39; property can only be set in or before the &#39;Page_PreInit&#39; event.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I have made a work around to change the theme on run time on click of a button:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Partial Class Default&lt;br /&gt;    Inherits System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;    Protected Sub btnChange_Click(ByVal sender As Object, _&lt;br /&gt;        ByVal e As System.EventArgs) Handles btnChange.Click&lt;br /&gt;        &#39;Cannot change theme on Click event&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Protected Sub Page_PreInit(ByVal sender As Object, _&lt;br /&gt;            ByVal e As System.EventArgs) Handles Me.PreInit&lt;br /&gt;        &#39;If Page is postback&lt;br /&gt;        If Me.IsPostBack = True Then&lt;br /&gt;            If Not Request(btnChange.UniqueID) Is Nothing Then&lt;br /&gt;                Me.Page.Theme = &quot;NewTheme&quot;&lt;br /&gt;            End If&lt;br /&gt;        End If&lt;br /&gt;&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;End Class&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;We have still changed the theme in &#39;Page_PreInit&#39; event but on click of a button.&lt;br /&gt;&lt;br /&gt;UniqueID of a control gets the unique, hierarchically qualified identifier for the server control. The fully qualified identifier for the server control, this is ID which is received as key when value is post back.&lt;br /&gt;&lt;br /&gt;The output of button is like this:&lt;br /&gt;&amp;lt;input type=&quot;submit&quot; name=&quot;btnChange&quot; value=&quot;Change Theme&quot; id=&quot;btnChange&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;Here name is what we call btnChange.UniqueID and id is what we call btnChane.ClientID, in HTML input controls &quot;id&quot; is used for client side validation and other java script things, and &quot;name&quot; attribute is used to identify the field when it is post back to server.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/5895859365592561723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-change-page-theme-on-runtime.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/5895859365592561723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/5895859365592561723'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-change-page-theme-on-runtime.html' title='ASP.NET Change Page Theme on Run time'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-1249033704272883889</id><published>2010-11-12T10:06:00.000-08:00</published><updated>2010-11-12T10:11:46.002-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql server"/><title type='text'>SQL Server 2005, Search string in Procedures and Functions</title><content type='html'>Use following sql script to search some string inside Stored procedure or User defined function, this is handy when you have lot of stored procedures and functions and you are looking for particular one, like i want to list procedures in which a specific Table has been used.&lt;br /&gt;&lt;br /&gt;This query search in procedures and functions script stored in database schema.&lt;br /&gt;&lt;br /&gt;USE DATBASENAME&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;-- SYS COMMENTS&lt;br /&gt;SELECT distinct so.name, so.xtype&lt;br /&gt;FROM syscomments sc&lt;br /&gt;INNER JOIN sysobjects so ON sc.id = so.id&lt;br /&gt;WHERE charindex(&#39;Search&#39;, text) &gt; 0&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--INFORMATION_SCHEMA.ROUTINES&lt;br /&gt;SELECT routine_name, routine_type&lt;br /&gt;FROM INFORMATION_SCHEMA.ROUTINES&lt;br /&gt;WHERE ROUTINE_DEFINITION LIKE &#39;%Search%&#39;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/1249033704272883889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/sql-server-2005-search-string-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/1249033704272883889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/1249033704272883889'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/sql-server-2005-search-string-in.html' title='SQL Server 2005, Search string in Procedures and Functions'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-4576204357677902237</id><published>2010-11-12T09:41:00.000-08:00</published><updated>2010-11-12T10:03:31.099-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><title type='text'>ASP.NET Circular File Reference</title><content type='html'>“Circular file references are not allowed” error occurs while building or deploying asp.net website, this can happen due to differnt reasons:&lt;br /&gt;&lt;br /&gt;1. When one ASCX control references another which contains a reference back to the first one&lt;br /&gt;2. When an ASCX control references another in a different directory that also contains other controls that reference back to the first one&lt;br /&gt;3. When a ASPX page references ASCX control in a different folder, that also contain other pages that reference this control&lt;br /&gt;&lt;br /&gt;There might be other reasons as well, ASP.NET website compiles into different libraries, which reference each other as well, .NET compiler bt default build libraries in batch, means files in one folder are batched together in a single library depending on the dependencies.&lt;br /&gt;&lt;br /&gt;In &quot;batch mode,&quot; the output of multiple source files is compiled into single assemblies according to the type of file, file dependencies, and other criteria. The result is a target site containing a set of assemblies with the executable code for the original source files.&lt;br /&gt;&lt;pre&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;    &amp;lt;compilation debug=&quot;true&quot; batch=&quot;false&quot;&amp;gt;&lt;br /&gt;    &amp;lt;/compilation&amp;gt;&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/pre&gt;&lt;br /&gt;Here batch=&quot;false&quot;tells the ASP.NET compiler to not batch assemblies, and create an assembly for each web form and user control. When it is set to true, then the compiler will batch assemblies.&lt;br /&gt;&lt;br /&gt;Circular reference is a by-product of the ASP.NET compiler &quot;batching&quot; assemblies together for performance reasons. By default it will take the web forms and user controls in a folder and compile them into an assembly.&lt;br /&gt;&lt;br /&gt;There are several ways to solve this issue, but we recommend moving the referenced pages (e.g. Pages2.aspx.vb and Pages3.aspx.vb) to their own folder. By default, the ASP.NET compiler will create a separate assembly containing these pages and the circular reference will be removed between Assembly A and B.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/4576204357677902237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-circular-file-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4576204357677902237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4576204357677902237'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-circular-file-reference.html' title='ASP.NET Circular File Reference'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-3703632187938978369</id><published>2010-11-10T23:45:00.000-08:00</published><updated>2011-05-22T01:31:07.646-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="microsoft"/><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>How to find Allocation Unit of your Disk Partition?</title><content type='html'>Default allocation unit of any disk partition under Windows operation system is 4096 bytes for drives under 16 TB, this is the information as per Microsoft article 140365. The allocation unit is also referred as Cluster size.&lt;br /&gt;&lt;br /&gt;Simple and fastest way to check what is the allocation unit size of any partition is as follows:&lt;br /&gt;&lt;br /&gt;Command:&lt;br /&gt;C:\Windows\system32&gt;fsutil fsinfo ntfsinfo C:&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;C:\Windows\system32&gt;fsutil fsinfo ntfsinfo C:&lt;br /&gt;NTFS Volume Serial Number :       0x0000000000000000&lt;br /&gt;Version :                         3.1&lt;br /&gt;Number Sectors :                  0x0000000000000000&lt;br /&gt;Total Clusters :                  0x0000000000000000&lt;br /&gt;Free Clusters  :                  0x0000000000000000&lt;br /&gt;Total Reserved :                  0x0000000000000000&lt;br /&gt;Bytes Per Sector  :               512&lt;br /&gt;Bytes Per Cluster :               4096&lt;br /&gt;Bytes Per FileRecord Segment    : 1024&lt;br /&gt;Clusters Per FileRecord Segment : 0&lt;br /&gt;Mft Valid Data Length :           0x0000000000000000&lt;br /&gt;Mft Start Lcn  :                  0x0000000000000000&lt;br /&gt;Mft2 Start Lcn :                  0x0000000000000000&lt;br /&gt;Mft Zone Start :                  0x0000000000000000&lt;br /&gt;Mft Zone End   :                  0x0000000000000000&lt;br /&gt;RM Identifier:        00000000-0000-0000-0000-000000000000&lt;br /&gt;&lt;br /&gt;In the above result &quot;Bytes per Cluster&quot; represents the allocation unit size.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Best Allocation unit Size:&lt;/h3&gt;&lt;br /&gt;Higher the allocation unit size better the performance, but lower the disk space available, because data is written in units, if you write 1 byte the allocation unit consumed will be 4096, with 4098 bytes wasted.&lt;br /&gt;&lt;br /&gt;Therefore if you are going to use a drive for large files like videos, or other multimedia formats, than higher allocation will be better. And for partitions that will hold documents like text files, etc. default allocation unit size is enough.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Size and Size on Disk:&lt;/h3&gt;&lt;br /&gt;If you are a windows user, you may have noted that when we view properties of any file or folder, the general tab mentions two sizes. One is the &quot;Size&quot; which is the actual size of the file and other is the &quot;Size on disk&quot; which is the space consumed on the drive.&lt;br /&gt;&lt;br /&gt;The difference in both size indicate how much space has been wasted.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/3703632187938978369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/how-to-find-allocation-unit-of-your.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/3703632187938978369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/3703632187938978369'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/how-to-find-allocation-unit-of-your.html' title='How to find Allocation Unit of your Disk Partition?'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-5108179520907566286</id><published>2010-11-03T09:24:00.000-07:00</published><updated>2011-12-23T04:43:30.042-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Abstract Class vs Interface</title><content type='html'>&lt;strong&gt;What is an Abstract Class?&lt;/strong&gt;&lt;br /&gt;An abstract class is a special kind of class that cannot be instantiated. So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What is an Interface?&lt;/strong&gt;&lt;br /&gt;An interface has no implementation; it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class, it is a contract that is used to define hierarchies for all subclasses or it defines specific set of methods and their arguments. The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class. Interfaces are used to implement multiple inheritance.&lt;br /&gt;&lt;br /&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;10&quot; cellspacing=&quot;0&quot; width=&quot;600&quot;&gt;&lt;thead style=&quot;font-weight:bold&quot;&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Feature&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Interface&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Abstract class&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Multiple inheritance&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;A class may inherit several interfaces.&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;A class may inherit only one abstract class.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Default implementation&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;An interface cannot provide any code, just the signature.&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;An abstract class can provide complete, default code and/or just the details that have to be overridden.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;Access Modfiers&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;An interface cannot have access modifiers for the subs, functions, properties etc everything is assumed as public&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;An abstract class can contain access modifiers for the subs, functions, properties&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Core VS Peripheral&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Interfaces are used to define the peripheral abilities of a class. In other words both Human and Vehicle can inherit from a IMovable interface.&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;An abstract class defines the core identity of a class and there it is used for objects of the same type.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Homogeneity&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;If various implementations only share method signatures then it is better to use Interfaces.&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;If various implementations are of the same kind and use common behaviour or status then abstract class is better to use.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Speed&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Requires more time to find the actual method in the corresponding classes.&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Fast&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;Adding functionality (Versioning)&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;If we add a new method to an Interface then we have to track down all the implementations of the interface and define implementation for the new method.&lt;/p&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;&lt;p&gt;If we add a new method to an abstract class then we have the option of providing default implementation and therefore all the existing code might work properly.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;Fields and Constants&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;No fields can be defined in interfaces&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;33%&quot;&gt;An abstract class can have fields and constrants defined&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Reference: &lt;a href=&quot;http://www.codeproject.com/KB/cs/abstractsvsinterfaces.aspx&quot;&gt;Abstract Class versus Interface&lt;/a&gt;&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/5108179520907566286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/abstract-class-vs-interface.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/5108179520907566286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/5108179520907566286'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/abstract-class-vs-interface.html' title='Abstract Class vs Interface'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-4453821906577643498</id><published>2010-11-03T08:42:00.000-07:00</published><updated>2010-12-30T08:56:08.434-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><category scheme="http://www.blogger.com/atom/ns#" term="design"/><title type='text'>Visual Basic .NET Data Type Summary</title><content type='html'>&lt;p&gt;The following table shows the Visual Basic data types, their supporting common language runtime types, their nominal storage allocation, and their value ranges.&lt;/p&gt;&lt;div&gt;&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; class=&quot;summarytable&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th align=&quot;left&quot;&gt;Visual Basic type&lt;/th&gt;&lt;th align=&quot;left&quot;&gt;Common language runtime type structure&lt;/th&gt;&lt;th align=&quot;left&quot;&gt;Nominal storage allocation&lt;/th&gt;&lt;th align=&quot;left&quot;&gt;Value range&lt;/th&gt;&lt;th align=&quot;left&quot;&gt;System.&lt;br /&gt;Data.SqlDbType&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Boolean &lt;/p&gt;&lt;/td&gt;&lt;td&gt;Boolean &lt;/p&gt;&lt;/td&gt;&lt;td&gt;Depends on implementing platform&lt;/td&gt;&lt;td&gt;True or False&lt;/td&gt;&lt;td&gt;Bit&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Byte&lt;/td&gt;&lt;td&gt;Byte&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;td&gt;0 through 255 (unsigned)&lt;/td&gt;&lt;td&gt;TinyInt&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Byte&lt;/td&gt;&lt;td&gt;Byte&lt;/td&gt;&lt;td&gt;Byte array&lt;/td&gt;&lt;td&gt;Array size&lt;/td&gt;&lt;td style=&quot;white-space:nowrap;&quot;&gt;Binary [8000]&lt;br /&gt;Image [2147483647]&lt;br /&gt;Timestamp [8]&lt;br /&gt;VarBinary [8000]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Char (single character)&lt;/td&gt;&lt;td&gt;Char&lt;/td&gt;&lt;td&gt;2 bytes&lt;/td&gt;&lt;td&gt;0 through 65535 (unsigned)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;DateTime&lt;/td&gt;&lt;td&gt;8 bytes&lt;/td&gt;&lt;td&gt;0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31, 9999&lt;/td&gt;&lt;td&gt;DateTime&lt;br /&gt;SmallDateTime&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Decimal&lt;/td&gt;&lt;td&gt;Decimal&lt;/td&gt;&lt;td&gt;16 bytes&lt;/td&gt;&lt;td&gt;0 through +/-79,228,162,514,264,337,593,543,950,335 (+/-7.9...E+28) † with no decimal point;&lt;br /&gt;0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal;&lt;br /&gt;smallest nonzero number is +/-0.0000000000000000000000000001 (+/-1E-28) †&lt;/td&gt;&lt;td&gt;Decimal&lt;br /&gt;Money&lt;br /&gt;SmallMoney&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Double (double-precision floating-point)&lt;/td&gt;&lt;td&gt;Double&lt;/td&gt;&lt;td&gt;8 bytes&lt;/td&gt;&lt;td&gt;-1.79769313486231570E+308 through -4.94065645841246544E-324 † for negative values;&lt;br /&gt;4.94065645841246544E-324 through 1.79769313486231570E+308 † for positive values&lt;/td&gt;&lt;td&gt;Float&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Integer&lt;/td&gt;&lt;td&gt;Int32&lt;/td&gt;&lt;td&gt;4 bytes&lt;/td&gt;&lt;td&gt;-2,147,483,648 through 2,147,483,647 (signed)&lt;/td&gt;&lt;td&gt;Int&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Long (long integer)&lt;/td&gt;&lt;td&gt;Int64&lt;/td&gt;&lt;td&gt;8 bytes&lt;/td&gt;&lt;td&gt;-9,223,372,036,854,775,808 through 9,223,372,036,854,775,807 (9.2...E+18 †) (signed)&lt;/td&gt;&lt;td&gt;BigInt&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Object&lt;/td&gt;&lt;td&gt;Object (class)&lt;/td&gt;&lt;td&gt;4 bytes on 32-bit platform&lt;br /&gt;8 bytes on 64-bit platform&lt;/td&gt;&lt;td&gt;Any type can be stored in a variable of type Object&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;SByte&lt;/td&gt;&lt;td&gt;SByte&lt;/td&gt;&lt;td&gt;1 byte&lt;/td&gt;&lt;td&gt;-128 through 127 (signed)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Short (short integer)&lt;/td&gt;&lt;td&gt;Int16&lt;/td&gt;&lt;td&gt;2 bytes&lt;/td&gt;&lt;td&gt;-32,768 through 32,767 (signed)&lt;/td&gt;&lt;td&gt;SmallInt&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Single (single-precision floating-point)&lt;/td&gt;&lt;td&gt;Single&lt;/td&gt;&lt;td&gt;4 bytes&lt;/td&gt;&lt;td&gt;-3.4028235E+38 through -1.401298E-45 † for negative values;&lt;br /&gt;1.401298E-45 through 3.4028235E+38 † for positive values&lt;/td&gt;&lt;td&gt;Real&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;String (variable-length)&lt;/td&gt;&lt;td&gt;String (class)&lt;/td&gt;&lt;td&gt;Depends on implementing platform&lt;/td&gt;&lt;td&gt;0 to approximately 2 billion Unicode characters&lt;/td&gt;&lt;td style=&quot;white-space:nowrap;&quot;&gt;Char [8000]&lt;br /&gt;Nchar [4000]&lt;br /&gt;Ntext [1073741823]&lt;br /&gt;NVarChar [4000]&lt;br /&gt;Text [2147483647]&lt;br /&gt;VarChar [8000]&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;UInteger&lt;/td&gt;&lt;td&gt;UInt32&lt;/td&gt;&lt;td&gt;4 bytes&lt;/td&gt;&lt;td&gt;0 through 4,294,967,295 (unsigned)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;ULong&lt;/td&gt;&lt;td&gt;UInt64&lt;/td&gt;&lt;td&gt;8 bytes&lt;/td&gt;&lt;td&gt;0 through 18,446,744,073,709,551,615 (1.8...E+19 †) (unsigned)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;User-Defined (structure)&lt;/td&gt;&lt;td&gt;(inherits from ValueType)&lt;/td&gt;&lt;td&gt;Depends on implementing platform&lt;/td&gt;&lt;td&gt;Each member of the structure has a range determined by its data type and independent of the ranges of the other members&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;UShort&lt;/td&gt;&lt;td&gt;UInt16&lt;/td&gt;&lt;td&gt;2 bytes&lt;/td&gt;&lt;td&gt;0 through 65,535 (unsigned)&lt;/p&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt; † In scientific notation, &amp;quot;E&amp;quot; refers to a power of 10. So 3.56E+2 signifies 3.56 x 102 or 356, and 3.56E-2 signifies 3.56 / 102 or 0.0356.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/4453821906577643498/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/visual-basic-net-data-type-summary.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4453821906577643498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/4453821906577643498'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/visual-basic-net-data-type-summary.html' title='Visual Basic .NET Data Type Summary'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-7743900510151483068</id><published>2010-11-02T03:26:00.000-07:00</published><updated>2010-12-26T03:59:27.155-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="aspnet"/><title type='text'>ASP.NET Control ClientID and UniqueID, Server control ID</title><content type='html'>When ever a Server control is rendered in ASP.NET it has two different identifiers, one is named as ClientID which is the &quot;id&quot; attribute and second is the UniqueID which is the &quot;name&quot; attribute.&lt;br /&gt;&lt;br /&gt;UniqueID of a control gets the unique, hierarchically qualified identifier for the server control. The fully qualified identifier for the server control, this is the ID which is received as key when value is post back.&lt;br /&gt;&lt;br /&gt;The output of button and a text box is like this:&lt;br /&gt;&amp;lt;input type=&quot;submit&quot; name=&quot;btnLoad&quot; value=&quot;Load&quot; id=&quot;btnLoad&quot; /&amp;gt;&lt;br /&gt;&amp;lt;input type=&quot;text&quot; name=&quot;txtName&quot; value=&quot;Hello&quot; id=&quot;txtName&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;Here &quot;name&quot; is what we call btnLoad.UniqueID and &quot;id&quot; is what we call btnLoad.ClientID, in HTML input controls &quot;id&quot; is used for client side validation and other java script things, and &quot;name&quot; attribute is used to identify the field when it is post back to server.&lt;br /&gt;&lt;br /&gt;These ID&#39;s are in a hierarchy, parent control id first and then child control id, like as follows:&lt;br /&gt;&lt;pre&gt;&amp;lt;asp:Repeater ID=&quot;rptrNames&quot; runat=&quot;server&quot;&amp;gt;&lt;br /&gt;    &amp;lt;ItemTemplate&amp;gt;&lt;br /&gt;        &amp;lt;asp:textbox runat=&quot;server&quot; ID=&quot;txtName&quot;&amp;gt;&amp;lt;/asp:textbox&amp;gt;&lt;br /&gt;    &amp;lt;/ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:Repeater&amp;gt;&lt;/pre&gt;&lt;br /&gt;The output of text box is like this:&lt;br /&gt;&amp;lt;input name=&quot;rptrNames$ctl00$txtName&quot; type=&quot;text&quot; id=&quot;rptrNames_ctl00_txtName&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input name=&quot;rptrNames$ctl01$txtName&quot; type=&quot;text&quot; id=&quot;rptrNames_ctl01_txtName&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;and so on.&lt;br /&gt;&lt;br /&gt;Here ctl00 and ctl01 is Id representing each item of the repeater, txtName is the id for control and rptrNames is the id of repeater control.&lt;br /&gt;The hierarchy of controls is like this:&lt;br /&gt;-Repeater control (Parent control)&lt;br /&gt;--Repeater item (Child control of repeater and parent control of text box)&lt;br /&gt;---TextBox inside each repeater item (Child control of repeater item)&lt;br /&gt;&lt;br /&gt;Therefore the UniqueID of textbox is &quot;rptrNames$ctl01$txtName&quot; and ClientID of texbox is &quot;rptrNames_ctl01_txtName&quot;.&lt;br /&gt;&lt;br /&gt;Another thing noticeable here is the separator between the parent and child control ID&#39;s, in case of UniqueID it is &quot;$&quot; dollar sign and in case of ClientID it is &quot;_&quot; underscore. This are fixed control id separators and can be accessed using the read-only property ClientIDSeparator() As Char and read-only property IdSeparator() As Char.&lt;br /&gt;&lt;br /&gt;The property ClientIDSeparator() As Char will return (_) underscore and the property IdSeparator() As Char will return ($).</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/7743900510151483068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-control-clientid-and-uniqueid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/7743900510151483068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/7743900510151483068'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/11/aspnet-control-clientid-and-uniqueid.html' title='ASP.NET Control ClientID and UniqueID, Server control ID'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-9106512139715186785</id><published>2010-11-01T21:43:00.000-07:00</published><updated>2011-06-13T21:46:00.090-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="windows"/><title type='text'>Microsoft Windows, Briefcase</title><content type='html'>This is a special folder which is used by mobile PC users, this folder provides synchronization feature, file synchronization can be done between briefcase and another folder. The briefcase is infact just a folder, but provides some additional features.&lt;br /&gt;&lt;br /&gt;The briefcase folder contains two files one &quot;desktop.ini&quot; and another &quot;Briefcase Database&quot;, both these files identify a briefcase folder.&lt;br /&gt;&lt;br /&gt;The &quot;desktop.ini&quot; file will look like this:&lt;br /&gt;&lt;br /&gt;[.ShellClassInfo]&lt;br /&gt;CLSID={86BAC831-52A0-1069-A2E4-08002B30309D}&lt;br /&gt;RunWizard=0&lt;br /&gt;[Briefcase]&lt;br /&gt;Database=Briefcase Database&lt;br /&gt;&lt;br /&gt;Whereas the &quot;Briefcase Database&quot; is a binary file and is used for synchronization process.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/9106512139715186785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2011/01/microsoft-windows-briefcase.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/9106512139715186785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/9106512139715186785'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2011/01/microsoft-windows-briefcase.html' title='Microsoft Windows, Briefcase'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-6786428903616169689</id><published>2010-05-31T21:56:00.000-07:00</published><updated>2010-06-01T21:57:22.384-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="visual studio"/><title type='text'>Visual Studio 2010, Build error, Build (web): Object reference not set to an instance of an object</title><content type='html'>When upgrading a from previous version, Crystal report build provider will cause builder error, in ASP.NET 4 crystal reports are also pre-compiled using build provider for (.rpt), when compiler tries to pre-compile reports build in previous version, a build error &quot;Object reference not set to an instance of an object&quot; is thrown and build fails.&lt;br /&gt;&lt;br /&gt;Possible work arround is to remove the build provider for (*.rpt) in your web.config:&lt;br /&gt;&lt;br /&gt;There will be following construct under &lt;compilation&gt; section:&lt;br /&gt;&lt;br /&gt;&amp;lt;buildProviders&amp;gt;&lt;br /&gt;        &amp;lt;add extension=&quot;.rpt&quot; type=&quot;CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304&quot;/&amp;gt;&lt;br /&gt;      &amp;lt;/buildProviders&amp;gt;&lt;br /&gt;&lt;br /&gt;We can change this to:&lt;br /&gt;&lt;br /&gt;&amp;lt;buildProviders&amp;gt;&lt;br /&gt;        &amp;lt;add extension=&quot;.rpt&quot; type=&quot;CrystalDecisions.Web.Compilation.RptBuildProvider, CrystalDecisions.Web, Version=14.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304&quot;/&amp;gt;&lt;br /&gt;        &amp;lt;remove extension=&quot;.rpt&quot;/&amp;gt;&lt;br /&gt;      &amp;lt;/buildProviders&amp;gt;&lt;br /&gt;&lt;br /&gt;What we have done is removed the build provider for (.rpt), in this way the crystal reports will remain as it is and no build error will show.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/6786428903616169689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/05/visual-studio-2010-build-error-build.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6786428903616169689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6786428903616169689'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/05/visual-studio-2010-build-error-build.html' title='Visual Studio 2010, Build error, Build (web): Object reference not set to an instance of an object'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-3978669892947634896</id><published>2010-05-27T23:42:00.000-07:00</published><updated>2011-05-28T01:48:32.590-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>Object Oriented Javascript (Part-1)</title><content type='html'>We can develop object oriented JavaScript using function method, in JavaScript functions are the main constructs that can be called or referenced. To write object oriented reusable JavaScript libraries we can utilize the similar function which use every day.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;JavaScript function:&lt;/strong&gt;&lt;br /&gt;At this point i assume that we know what a function is, for quick example it is as follows:&lt;br /&gt;&lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;    //Declare a JavaScript function&lt;br /&gt;    function helloWorld()&lt;br /&gt;    {&lt;br /&gt;        alert(&#39;This is my first function.&#39;);       &lt;br /&gt;    }&lt;br /&gt;   &lt;br /&gt;    //calling a JavaScript function&lt;br /&gt;    helloWorld();&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;JavaScript Class&lt;/strong&gt;&lt;br /&gt;There is no syntax to declare classes in javascript, but purpose of object class is to encapsulate data and provide some attributes or methods for outer world. This can still be achieved in JavaScript using the same function.&lt;br /&gt;Functions in JavaScript can be instantiated, which means we can create multiple copies of a JavaScript function the same way as we can create instances of a class.&lt;br /&gt;&lt;br /&gt;There are different ways to do that, the simplest way is as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;    //Declare a JavaScript Class&lt;br /&gt;    function Car(car_color)&lt;br /&gt;    {&lt;br /&gt;        //Initialize attributes with default values&lt;br /&gt;        this.Color = car_color;&lt;br /&gt;        this.Model = &#39;&#39;;&lt;br /&gt;        this.Make = &#39;&#39;;&lt;br /&gt;        //Methods&lt;br /&gt;        this.getModel = function() {&lt;br /&gt;            return this.Model;&lt;br /&gt;        }&lt;br /&gt;        this.setModel = function(car_model) {&lt;br /&gt;            this.Model = car_model;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    //Instantiate&lt;br /&gt;    var car1 = new Car(&#39;Red&#39;);&lt;br /&gt;    var car2 = new Car(&#39;Black&#39;);&lt;br /&gt;    //Set attributes&lt;br /&gt;    //Car1&lt;br /&gt;    car1.Make = &#39;Honda&#39;;&lt;br /&gt;    car1.setModel(&#39;2009&#39;);&lt;br /&gt;    //Car2&lt;br /&gt;    car2.Make = &#39;Ford&#39;;&lt;br /&gt;    car2.setModel(&#39;2008&#39;);&lt;br /&gt;    //Call instance method&lt;br /&gt;    alert(car1.getModel());&lt;br /&gt;    alert(car2.getModel());&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;In the above example we can see how two instance of car were created, initialized and accessed in the JavaScript. This simple approach can help in creating reusable code which is encapsulated in a function, this way JavaScript is more manageable and help a lot when you are doing complex scripting.</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/3978669892947634896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/05/object-oriented-javascript-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/3978669892947634896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/3978669892947634896'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/05/object-oriented-javascript-part-1.html' title='Object Oriented Javascript (Part-1)'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-6470527539649468360</id><published>2010-03-23T22:24:00.000-07:00</published><updated>2010-03-23T22:30:09.803-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="tipsandtricks"/><title type='text'>WampServer 2.0 Port Configuration</title><content type='html'>&lt;p&gt;Now that you have WampServer 2.0 installed, you&#39;ll want to use it along side with other servers such as IIS. This is easily done by changing the port that WampServer 2.0 listens to. I suggest changing the port from 80 to 81.&lt;/p&gt;&lt;p&gt;Use Notepad or WordPad to open the files below.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Open the httpd.conf file for the Apache server. On my machine, it&#39;s located here:&lt;br&gt;&lt;br&gt;C:\wamp\bin\apache\apache2.2.6\conf\httpd.conf&lt;br&gt;&lt;ul&gt;&lt;li&gt;Do a search for &quot;Listen 80&quot; and replace it with &quot;Listen 81&quot;.&lt;/li&gt;&lt;li&gt;Save and close the file.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Open the wampmanager.tpl file. On my machine, it&#39;s located here:&lt;br&gt;&lt;br&gt;C:\wamp\wampmanager.tpl&lt;br&gt;&lt;ul&gt;&lt;li&gt;Do a search for &quot;http://localhost/&quot; and replace it with &quot;http://localhost:81/&quot; (There are three total).&lt;/li&gt;&lt;li&gt;Do a search for &quot;${w_testPort80}&quot; and replace it with &quot;${w_testPort81}&quot;.&lt;/li&gt;&lt;li&gt;Save and close the file.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Open the testPort.php file. On my machine, it&#39;s located here:&lt;br&gt;&lt;br&gt;C:\wamp\scripts\testPort.php&lt;br&gt;&lt;ul&gt;&lt;li&gt;Do a search for &quot;80&quot; and replace it with &quot;81&quot; (There are three total).&lt;/li&gt;&lt;li&gt;Save and close the file.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Open the english.lang file. On my machine, it&#39;s located here:&lt;br&gt;&lt;br&gt;C:\wamp\lang\english.lang&lt;br&gt;&lt;ul&gt;&lt;li&gt;Do a search for &quot;$w_testPort80 = &#39;Test Port 80&#39;;&quot; and replace it with &quot;$w_testPort81 = &#39;Test Port 81&#39;;&quot;.&lt;/li&gt;&lt;li&gt;Save and close the file.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br&gt;&lt;li&gt;Right click on the WampServer icon and click on &quot;Exit&quot;.&lt;/li&gt;&lt;br&gt;&lt;li&gt;Restart your WampServer.&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/6470527539649468360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/03/wampserver-20-port-configuration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6470527539649468360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/6470527539649468360'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/03/wampserver-20-port-configuration.html' title='WampServer 2.0 Port Configuration'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5021003743199290743.post-8900518441805493184</id><published>2010-03-12T21:47:00.000-08:00</published><updated>2010-06-01T21:54:36.703-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>SQL Server 2005 - Get Size of Databases</title><content type='html'>EXEC DATABASE.dbo.sp_spaceused&lt;br /&gt;&lt;br /&gt;EXEC DATABASE.dbo.sp_spaceused &#39;TABLE_NAME&#39;&lt;br /&gt;&lt;br /&gt;EXEC DATABASE.dbo.sp_spaceused &#39;?&#39;</content><link rel='replies' type='application/atom+xml' href='http://software-works.blogspot.com/feeds/8900518441805493184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://software-works.blogspot.com/2010/03/sql-server-2005-get-size-of-databases.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/8900518441805493184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5021003743199290743/posts/default/8900518441805493184'/><link rel='alternate' type='text/html' href='http://software-works.blogspot.com/2010/03/sql-server-2005-get-size-of-databases.html' title='SQL Server 2005 - Get Size of Databases'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>