Suresh Behera

The Microsoft .Net Junkies

News

Blogroll

Reading

December 2007 - Posts

SQL Server Interview Questions and Answers

Awsome list of SQL Server Inteview Question by Pinal Dave...Hats off pinal.

Download SQL Server Interview Questions and Answers Complete List

Complete Series of SQL Server Interview Questions and Answers
SQL Server Interview Questions and Answers - Introduction
SQL Server Interview Questions and Answers - Part 1
SQL Server Interview Questions and Answers - Part 2
SQL Server Interview Questions and Answers - Part 3
SQL Server Interview Questions and Answers - Part 4
SQL Server Interview Questions and Answers - Part 5
SQL Server Interview Questions and Answers - Part 6
SQL Server Interview Questions and Answers Complete List Download


Other popular Series

SQL SERVER Database Coding Standards and Guidelines Complete List Download
SQL SERVER - Data Warehousing Interview Questions and Answers Complete List Download
DBA Database SQL Job List Search

 I see his blog has 164 list of thank you from various people...He did a great job and very impressive.

Thanks,

Suresh Behera
www.sureshbehera.com

 

DataTable filter on DateTime coloum

I was surprise to know that 'DateTime.Parse' does not parse fractions of a second and this was messing up our Dataview filter.Here is nice tips from furum.

The Select expression you are using uses DateTime.Parse internally.

DateTime.Parse does not parse fractions of a second, even if you were to include them in your expression. 

I can't see DateTime.Parse ever being changed for backwards compatibility reasons.  You basically have two solutions.

1. Truncate the DateTime to an exact second before inserting in your DataTable, e.g.:



locTimeVariable = TruncateToSecond(System.DateTime.Now.AddDays(i));

 

There are a number of ways you could implement the "TruncateToSecond" helper method.  Here are two - you might like to test to see which is fastest:



static DateTime TruncateToSecond(DateTime dateTime)
{
    return new DateTime(dateTime.Year, dateTime.Month, dateTime.Day, dateTime.Hour, dateTime.Minute, dateTime.Second, dateTime.Kind);
}

 

static DateTime TruncateToSecond(DateTime dateTime)
{
   
return new DateTime((dateTime.Ticks / TimeSpan.TicksPerSecond) * TimeSpan.TicksPerSecond, dateTime.Kind );
}

 

2. Alternatively you could specify a range of times from N to N + 1 second, for example:



"MyColumn>=#" + locTimeVariable.ToString(DateTimeFormatInfo.InvariantInfo) +
"# AND MyColumn<" + locTimeVariable.AddSeconds(1).ToString(DateTimeFormatInfo.InvariantInfo) + "#";

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=356919&SiteID=1

Thanks,

Suresh Behera
 

 

HTML tables sorting

Cool javascript code for HTML cliend side sorting

http://www.mingyi.org/other/ts_demo.html#author  - This work great..Mingyi did a great job
http://www.grainge.org/pages/authoring/tables/sorting_mingyi.org/sortrows.htm
http://www.kryogenix.org/code/browser/sorttable/#totalsrows

Sorting HTML Tables using Javascript
http://www.codeproject.com/KB/scripting/sorttable.aspx?df=100&forumid=2945&exp=0&select=578716

Have a fun..

Thanks,

Suresh Behera
www.sureshbehera.com

 

 

 

Posted: Dec 14 2007, 10:20 AM by Suresh Behera | with 2 comment(s) |
Filed under: , ,
AJAX Activity Indicators

There is cool AJAX activity indicator...Check it out..

 http://www.napyfab.com/ajax-indicators/

 Thanks,

Suresh Behera
www.sureshbehera.com

Posted: Dec 10 2007, 10:43 AM by Suresh Behera | with 4 comment(s) |
Filed under: ,
More Posts