The techie in me RSS 2.0
 Monday, August 30, 2010

Recently I was trying to find duplicate records in a table. The records are considered duplicate if two columns in different records has the same value. For example if first name and last name is same in record1 and record2, they considered as duplicate.

The below query will help to find the duplicate records.

SELECT fname, lname, COUNT(*) AS DuplicateCount FROM [Users]
GROUP BY fname, lname HAVING COUNT(*) > 1
ORDER BY COUNT(*), fname.

 

(I know this is pretty simple one, but most of the time you struggle for the simplest query :) so thought of sharing it)

Monday, August 30, 2010 10:13:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Database
 Saturday, April 10, 2010

String.Replace is not case insensitive, so what is the best way to do it. There are several ways, if I think of the quickest one it is using regex.

using System.Text.RegularExpressions;string 
string str = "The quick brown Fox jumps over the lazy dog";
string strReplace = "cat";
string result = Regex.Replace(str, "fox", strReplace, RegexOptions.IgnoreCase);

-Rujith

 

Saturday, April 10, 2010 10:18:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] -
Coding
 Monday, February 08, 2010

I had lot of trouble in my last project due the html body onload event. The aspx pages were relying lot on this event ( I agree its not the best way, but we don't have the budget and time for to rebuild the entire site). These sites were AJAXyfied recently using Telerik RadControls, and were not working in FireFox. I must admin Telerik controls are really good, its makes your job very easy in AJAX world. Though I don't like their quarterly release idea. YES, they release a new version every quarter...

So the problem in AJAX is, the page can be loaded asynchronously, so when the onload event on the body is fired the controls may not be ready, so you get null exceptions.

The best way I found is to use the built in ‘pageLoad()’ method(this is a reserved method). This will be called once all AJAX load events are finished. Remember you can use this only in AJAX pages. Also this is consistent in different browsers. (If you are going with FireFox you have to use window.load=function() instead onload=function())

Coding is fun

-Rujith

Monday, February 08, 2010 12:32:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Coding
 Sunday, February 07, 2010

Maximum request length matters when you want to allow upload/download of large files.

This is one of the major change in IIS7. In previous version the default is 4MB, in IIS7 its 28.6MB. So when you deploy your ASP.NET application you will see that it will work for files larger than 4MB, but will give as soon as you cross the 28MB.

In IIS 7, the attribute has been changed to maxAllowedContentLength and it has to appear in <system.webServer> section (as for all IIS 7 settings). The complete attribute will look something like this…

<system.webServer>
<
security > <requestFiltering> <requestLimits maxAllowedContentLength="3072000000" /> </requestFiltering> </security>

 

Sunday, February 07, 2010 12:18:00 AM (GMT Standard Time, UTC+00:00)  #    Comments [1] -
Coding | WCF
 Tuesday, January 12, 2010

I ran into trouble during deploying a WCF service on IIS7 with https.

There's a great resource on all things WCF Security related here

http://www.codeplex.com/WCFSecurity

This helped me a lot.

Tuesday, January 12, 2010 7:50:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
WCF
 Sunday, January 10, 2010

When you are working with Active Directory the following may be useful,

Import and export directory objects – CSVDE & LDIFDE
ex: from the command prompt try CSVDE -f C:\Exportfile.csv
more help is available in this KB article.

Another useful utility while working with Active directory and LDAP(Light Weight Directory Access Protocol) is ADSI Edit (adsiedit.msc). Nice link if you want to know in detail.

Also found this interesting link with attributes and its description for AD Users. see here. And check this script to list all User object attributes in active directory schema.

Sunday, January 10, 2010 10:23:00 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Coding
About me
Name : Rujith Anand Send mail to the author(s)
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Blogs I read
Disclaimer

Disclaimer
Postings are provided as is with no warranties, and confer no rights. Opinions expressed here are my own delusions; my employers at best shake their heads and sigh, at worst repudiate the content with extreme prejudice, whenever it manages to appear on their radar.

© Copyright 2010
Rujith Anand

Statistics
Advertisement
All Content © 2010, Rujith Anand