Tuesday, March 29, 2011

Export CSV from Dataset [ VB .Net Tutorial ]

Export CSV from Dataset [ VB .Net Tutorial ]

Bam! This guy has a very elegant solution for converting DataTable to CSV. He even accounts for the case of Text Qualifiers (which has burnt me in the past on CSV converters). This is going in my utility code bank.

Thanks Mr. Pon Saravanan --


Thursday, March 17, 2011

dnpextensions - Release: Release 2011.03

dnpextensions - Release: Release 2011.03

Awesome set of extension methods for .NET!

Format Eval("Date") : The Official Microsoft ASP.NET Forums

Format Eval("Date") : The Official Microsoft ASP.NET Forums

This will make the 1000th time I've had to look this up, ack!



        
                
      

ShowMessage jQuery plug-in

ShowMessage jQuery plug-in

This plug in is totally awesome! Simple, easy to use and looks good ...

Symantec Endpoint Protection virus definition folder consumes a large amount of disk space - Powered by Kayako SupportSuite Help Desk Software

Symantec Endpoint Protection virus definition folder consumes a large amount of disk space - Powered by Kayako SupportSuite Help Desk Software

grr. symantec... i wouldn't use you if it weren't forced on me in every corporate environment.

"Question/Issue:
Virus definitions consume a large amount of disk space.
 
Symptoms:
The virus definition folder that is located in C:\Program Files\Common Files\Symantec Shared\VirusDefs fills with temporary folders. The temporary folders are called tmpXXXX.tmp, where XXXX are hexadecimal characters. The temporary folders take up large amounts of disk space.
Cause:
Virus definitions may be corrupted.
 Solution:
 WARNING: Do not clear the VirusDefs folder if LiveUpdate Administrator (LUA) 2.1 is installed. This will cause LUA to report that engine updates are corrupt until the next set of engine updates is released.

To solve this issue, follow these steps:

Stop the Symantec Management Client service by following these directions:
Go to Start > Run
Type smc –stop
Click OK.

Stop the Symantec Endpoint Protection service in services by following these directions:
Go to Start > Run
Type services.msc
Right-click on Symantec Endpoint Protection service and select Stop.


Navigate to :\Program Files\Common Files\Symantec Shared\Virusdefs
Delete any numbered folders
Delete all files and folders with a ".tmp" extension


Install a new set of definitions manually using the Intelligent Updater (as explained in How to update definitions for Symantec Endpoint Protection 11.0 using the Intelligent Updater)
Restart the Symantec Endpoint Protection Service in services
Restart the Symantec Management Client service
Go to Start > Run
Type smc –start
Click OK


Technical Information:
A utility has been created to accomplish the above described procedure automatically. The SymDelTmps utility will search and delete
temporary files and zero byte.dax files that are the result of a corrupt database or definition set. To obtain the utility, contact Symantec Technical support at:
http://www.symantec.com/business/support/index.jsp "

Monday, March 14, 2011

Visual Studio Styles at StudioStyl.es

Sweet! I have been looking for a place that does VS styles!

http://studiostyl.es/

Friday, March 11, 2011

ReportViewer rendering maxes out thread CPU usage

Great solution to a problem that has been bugging me for a while... thanks
http://www.google.me/support/forum/p/Chrome/thread?tid=331a0a766d6da660&hl=en

"ReportViewer rendering maxes out thread CPU usage
[from: iainrobins] While testing our new site deployment we discovered that any page that renders a server-side SQL server report via a reportviewer ASP control, will cause the rendering thread to occupy the entire core it uses. (i.e. if you have 4 cores, it will show up as 25% CPU usage, 2 cores 50%, etc) Not exactly an ideal user experience, and I'm hoping that we won't have to tell our users not to use Chrome to view the site.


This is not a problem in any other browser we have tested (Safari, IE, Mozilla, Opera) so I doubt it's a problem with the report itself. Can anyone confirm the existence of this problem? I didn't see it in the known issues. If an example is required, we will be launching a private beta of our service in about a week and can provide a URL to a Google employee to test against.

Google Chrome version (type in about:version into the address bar): 3.0.195.27 (Official Build 28507)
Operating System: Windows XP/Vista"

Solution (from jaredhite1)

"I ended up just creating a control inheriting from ReportViewer and replacing the faulty javascript with a hack guaranteed to stop the loop. I did brief checks in IE, Chrome, Firefox, and Safari (all on Windows 7) and verified it didn't stop the normal behavior of my report, and also verified that it wasn't taking up 100% of one of my cores.


If I wanted to spend more time I'd do something more fancy, probably set a variable to make sure the location.Replace() only happens once.

using System;
using System.Web.UI;
using System.IO;

namespace MyCompany.Common
{
public class CustomReportViewer : Microsoft.Reporting.WebForms.ReportViewer
{
protected override void Render(HtmlTextWriter writer)
{
using (StringWriter sw = new StringWriter())
{
HtmlTextWriter tmpWriter = new HtmlTextWriter(sw);
base.Render(tmpWriter);
string val = sw.ToString();
val = val.Replace(@"!= 'javascript:\'\''", @"!= 'javascript:\'\'' && false");
writer.Write(val);
}
}
}
}"

Thursday, March 10, 2011

Display Your Data Your Way with Custom Renderers for Reporting Services

Display Your Data Your Way with Custom Renderers for Reporting Services

"SQL Server™ 2005 Reporting Services from Microsoft is a great tool that offers a centralized approach to storing and rendering reports. It also allows users to view and download reports without installing additional software. But what's most convenient for users is that reports can be saved in any number of different formats using custom report renderers. In this article, I will demonstrate how to develop one such report renderer that outputs HTML reports, but the skills you'll learn can easily be used to create a renderer for Microsoft® Word documents or any other format of your choosing.

SQL Server 2005 includes many new features and enhancements. These include support for stored procedures written in managed code, user defined functions, and managed user-defined data type (UDT) support, which provides flexibility and reduces the need for data type conversion when reading and saving data to and from the database. As you will see, these particular features will come in handy when you build your custom report renderer"

Great article - even if it is a little old...

Wednesday, March 2, 2011

Wicked Code: Asynchronous Pages in ASP.NET 2.0

Wicked Code: Asynchronous Pages in ASP.NET 2.0

Microsoft .NET & C#: Lightweight Service Bus frameworks

Microsoft .NET & C#: Lightweight Service Bus frameworks

Messaging/Queuing is a growing interest of mine. This guy breaks down the common patterns and frameworks well.

Manipulating Uploaded Files

Manipulating Uploaded Files
"If you need to perform additional actions on uploaded files before saving them (for example, if you are using custom fields), or if you want to manipulate them in memory without saving them, you can use the RadUpload server-side API. You can use the server-side API to rename uploaded files or save them into a database, or other storage medium."

Phew!

Tuesday, March 1, 2011

getting dynamic results from a dynamic query in sql server

file this under "hack-tacular" or "kludge-errific" -- if you need to get a dynamic result of a dynamic sql statement, you can use this method.  the reasons behind why we're using dynamic sql and getting dynamic values are not important right now :)

                create table #tmp_hack_for_getting_value (val varchar(100))

SET @value_sql = '
truncate table #tmp_hack_for_getting_value
declare @v varchar(100)
SELECT @v = (' + ISNULL(@record_count_sql,'0') + ')
INSERT INTO #tmp_hack_for_getting_value (val) values (@v)
'


exec(@value_sql)
SELECT @value = val FROM #tmp_hack_for_getting_value