<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>faizan ahmad</title>
    <link rel="self" type="application/xml" href="http://geekswithblogs.net/faizanahmad/Atom.aspx" />
    <subtitle type="html"> </subtitle>
    <id>http://geekswithblogs.net/faizanahmad/Default.aspx</id>
    <author>
        <name>faizanahmad</name>
        <uri>http://geekswithblogs.net/faizanahmad/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 0.0.0.0">Subtext</generator>
    <updated>2009-09-17T11:19:58Z</updated>
    <entry>
        <title>Error:'This field name is not known' in Crystal Report when using  a SQL View</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/09/17/errorthis-field-name-is-not-known-in-crystal-report-when.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/09/17/errorthis-field-name-is-not-known-in-crystal-report-when.aspx</id>
        <published>2009-09-17T10:45:52-05:00:00</published>
        <updated>2009-09-17T11:19:58Z</updated>
        <content type="html">&lt;p&gt;I got this error on production for a report which was working fine in Dev and it took me a while to figure out the cause.&lt;/p&gt;
&lt;p&gt;Report's Data Source was pointing to a SQL Server View, when I looked at the SQL Query ( Database - &amp;gt; Show SQL Query ), I noticed that Database name was there with view name: "DbName.dbo.ViewName"&lt;/p&gt;
&lt;p&gt;I did a lot of googling, trying to figure out a way to change this behaviour and have just "dbo.ViewName" in SQL, but in vain.&lt;/p&gt;
&lt;p&gt;For now, I have fixed it by putting the SQL in the view within a Command in Crystal Report and its working. &lt;/p&gt;
&lt;p&gt;Its kind of OK for this report as view had a small SQL and report is pretty small.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I would love to find REAL solution though, Crystal Reports does not always put the DBName with View.&lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/134865.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/134865.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/134865.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/134865.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Line Feed in HTML Mail to avoid Line Too long error</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/09/14/line-feed-in-html-mail-to-avoid-line-too-long.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/09/14/line-feed-in-html-mail-to-avoid-line-too-long.aspx</id>
        <published>2009-09-14T11:59:35-05:00:00</published>
        <updated>2009-09-15T11:23:43Z</updated>
        <content type="html">&lt;p&gt;Most of the times 'SMTP proxy service on Firewall ' would not allow a line longer  than '999' characters in HTML email. The solution would be to put a line feed in the HTML string of the mail 900 characters.&lt;/p&gt;
&lt;p&gt;If you put this Line feed into the HTML string, it might break the formating.  The right approach will be to put linefeed in the text fields ( e.g. Comments / Description) at appropriate position.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I ended up putting linefeed every 200 characters: &lt;/p&gt;
&lt;p&gt; &lt;font face=""&gt;int j = TextColumn.Length/200;&lt;br /&gt;
for(int i=1;i&amp;lt;=j;i++)&lt;br /&gt;
{&lt;br /&gt;
          TextColumn = TextColumn.Insert(i * 200,Environment.NewLine);&lt;br /&gt;
}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/134806.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/134806.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/134806.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/134806.aspx</trackback:ping>
    </entry>
    <entry>
        <title>A couple of Good links for SQL Server Pivots</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/08/19/a-couple-of-good-links-for-sql-server-pivots.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/08/19/a-couple-of-good-links-for-sql-server-pivots.aspx</id>
        <published>2009-08-19T16:15:23-05:00:00</published>
        <updated>2009-08-19T16:15:23Z</updated>
        <content type="html">&lt;p&gt;&lt;font face=""&gt;&lt;a href="http://www.simple-talk.com/community/blogs/andras/archive/2007/09/14/37265.aspx"&gt;http://www.simple-talk.com/community/blogs/andras/archive/2007/09/14/37265.aspx&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;&lt;a href="http://www.tsqltutorials.com/pivot.php"&gt;http://www.tsqltutorials.com/pivot.php&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;PS: For more complex  Queries, inner SQL's Group By are important and you might also need to use Sum in inner SQL&lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/134202.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/134202.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/134202.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/134202.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Hide table column Dynamically in SQL Server Reporting Services (SSRS)</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/08/19/hide-table-column-dynamically-in-sql-server-reporting-services-ssrs.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/08/19/hide-table-column-dynamically-in-sql-server-reporting-services-ssrs.aspx</id>
        <published>2009-08-19T16:10:10-05:00:00</published>
        <updated>2009-08-19T16:16:49Z</updated>
        <content type="html">&lt;p&gt;Quite Straight forward:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Select the Column , Right Click -&amp;gt; Propoerties OR hit F4&lt;/li&gt;
    &lt;li&gt;Visibility -&amp;gt; Hidden -&amp;gt; Expression i.e. Click on Hidden under Visibility and select Expression from Drop Down&lt;/li&gt;
    &lt;li&gt;Write the expression e,g.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;=IIF(Parameters!MonthlyOrYearly.Value.Equals(&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"Monthly"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;),&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;false&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;,&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/134201.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/134201.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/134201.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/134201.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Format Date in SQL Server Reporting Services</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/08/19/format-date-in-sql-server-reporting-services.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/08/19/format-date-in-sql-server-reporting-services.aspx</id>
        <published>2009-08-19T16:02:30-05:00:00</published>
        <updated>2009-08-19T16:17:33Z</updated>
        <content type="html">&lt;p&gt;compared to FormatDateTime Good old 'Format' function makes the job a lot easier :&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;&lt;font size="2"&gt; Format(Fields!ResultDate.Value,&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"M/d/yyyy"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
    &lt;li&gt;Format(Fields!ResultDate.Value,&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"yyyy"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;=IIF(Parameters!MonthlyOrYearly.Value.Equals(&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;Monthly"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;),Format(Fields!ResultDate.Value,&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"M/d/yyyy"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;),Format(Fields!ResultDate.Value,&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;"yyyy"&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;))&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/134200.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/134200.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/134200.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/134200.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Add new column/field in Oracle DB table - ora - 30649: missing Directory</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/08/07/add-new-columnfield-in-oracle-db-table---ora.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/08/07/add-new-columnfield-in-oracle-db-table---ora.aspx</id>
        <published>2009-08-07T11:21:03-05:00:00</published>
        <updated>2009-08-07T11:21:03Z</updated>
        <content type="html">&lt;p&gt;I was trying to add a new field in an Oracle DB table using this script:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;alter table TABLENAME add FIELDNAME char(1) not null default '0'  ; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;it was throwing an error:&lt;/p&gt;
&lt;p&gt;'ORA-30649:missing directory keyword'&lt;/p&gt;
&lt;p&gt;it drove me nutts for a while and after some googling, I was able to figure it out, its the Order: 'not null' should come after default value. right script is:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;alter table TABLENAME add FIELDNAME char(1)  default '0'  not null; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;order does matter :)&lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/133965.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/133965.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/133965.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/133965.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Pass Multiple values to Modal Window</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/03/25/pass-multiple-values-to-modal-window.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/03/25/pass-multiple-values-to-modal-window.aspx</id>
        <published>2009-03-25T17:16:14-05:00:00</published>
        <updated>2009-03-26T13:12:15Z</updated>
        <content type="html">A JavaScript object can be of great help when you need to pass multiple values to a Modal Window. E.G.&lt;br /&gt;
&lt;br /&gt;
 var objArgs = new Object();&lt;br /&gt;
 objArgs.Value1 = "Value 1";&lt;br /&gt;
 objArgs.Value2 = 2;&lt;br /&gt;
 var modalWindowFeatures = 'dialogHeight:600px;dialogWidth:600px;scroll:no;status:no;resizable:no';&lt;br /&gt;
  url = 'relative/path/to/page';&lt;br /&gt;
  var returnValue;&lt;br /&gt;
&lt;br /&gt;
  returnValue = window.showModalDialog(url,objArgs,modalWindowFeatures );&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/130427.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/130427.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/130427.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/130427.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Subquery returned more than 1 value</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/02/04/subquery-returned-more-than-1-value.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/02/04/subquery-returned-more-than-1-value.aspx</id>
        <published>2009-02-04T14:52:53-06:00:00</published>
        <updated>2009-02-04T14:52:53Z</updated>
        <content type="html">&lt;span style="font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;"Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, &amp;lt;, &amp;lt;= , &amp;gt;, &amp;gt;= or when the subquery is used as an expression"&lt;br /&gt;
&lt;br /&gt;
As the error message suggests , this normally occurs when you are assigning a T-SQL variable a value within sql query and the query is returning more that one rows e.g.&lt;br /&gt;
Declare @var1 nvarchar(50)&lt;br /&gt;
' select @var1=name from table1'&lt;br /&gt;
&lt;br /&gt;
Putting 'top 1' can resolve the problem  in many cases ( do check the business logic aspects):&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;' select top 1 @var1=name from table1'&lt;/span&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/129203.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/129203.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/129203.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/129203.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Install Visual Studio 2003 when Visual 2005 is intalled already</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/01/26/install-visual-studio-2003-when-visual-2005-is-intalled-already.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/01/26/install-visual-studio-2003-when-visual-2005-is-intalled-already.aspx</id>
        <published>2009-01-26T15:38:16-06:00:00</published>
        <updated>2009-02-17T10:10:16Z</updated>
        <content type="html">&lt;p&gt;other day I had to install Visual studio.NET 2003 on my system, the problem was I had Visual Studio 2005 and 2008 with framework 2.0 and 3.5 and I did not have .NET 1.1 on it.&lt;/p&gt;
&lt;p&gt;There were two suggetions from ppl at work:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Install .NET framework 1.1 and load project in VS 2005&lt;/li&gt;
    &lt;li&gt;You will need to Un install VS 2005 and 2008 and then install VS.NET 2003&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After googling a little first idea did not seem workable and I was not ready to  follow the second option of starting all over. Half hour down I found a solution:&lt;font face="Arial"&gt;&lt;a href="http://geekswithblogs.net/faizanahmad/Default.aspx"&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The trick is to install .NET framework 1.1 separately first and then run Visual studio 2003 installer.&lt;/p&gt;
&lt;p&gt;-- Follow UP&lt;/p&gt;
&lt;p&gt;VS 2003 is working fine, VS 2005 and SQL Server 2005 prompt an error on start   "unable to load file, this error could not be resolved, Please reinstall the application". It seems to work fine though.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/128977.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/128977.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/128977.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/128977.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Scroll Div on page load</title>
        <link rel="self" type="text/html" href="http://geekswithblogs.net/faizanahmad/archive/2009/01/08/scroll-div-on-page-load.aspx" />
        <id>http://geekswithblogs.net/faizanahmad/archive/2009/01/08/scroll-div-on-page-load.aspx</id>
        <published>2009-01-08T16:36:18-06:00:00</published>
        <updated>2009-01-08T16:36:18Z</updated>
        <content type="html">If you have a gridview/repeater control or other tabular data within a div, scroll bar appears when height  of data gets bigger than that of DIV.&lt;br /&gt;
If you want to scroll down to a certain position, you can use 'Element.scrollTop' property in Javascript:&lt;br /&gt;
&lt;br /&gt;
document.getElementById(divWithScroll').scrollTop = PixelsToScroll;&lt;br /&gt;
&lt;br /&gt;
Calculating the PixelsToScroll may vary depending on scenerio,&lt;br /&gt;
&lt;br /&gt;
In my case, I wanted to scroll down to a selected row within Repeater control. Row was selected using RadioButton and page was reloaded on selection of RadioButton. So, I saved the SelectedItem.ItemIndex  in Repeater_ItemDataBound in a hidden field and using the value in Javascript like following:&lt;br /&gt;
&lt;br /&gt;
PixelsToScroll = SelectedItem * 22;&lt;br /&gt;
&lt;br /&gt;
where 22 is height of table row&lt;img src="http://geekswithblogs.net/faizanahmad/aggbug/128500.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://geekswithblogs.net/faizanahmad/comments/128500.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://geekswithblogs.net/faizanahmad/comments/commentRss/128500.aspx</wfw:commentRss>
        <trackback:ping>http://geekswithblogs.net/faizanahmad/services/trackbacks/128500.aspx</trackback:ping>
    </entry>
</feed>