Total Pageviews

Wednesday, February 20, 2013

Reseeding a SQL Server Table

Indentity column will be reset to the value specified.

DBCC CHECKIDENT (tablename, RESEED, 5)

Sunday, January 20, 2013

Validating upload control for file extentions


Regular expression ="^.+(.doc|.DOC|.docx|.DOCX|.txt|.TXT|.pdf|.PDF)$"

Sunday, January 13, 2013

Finding column name on SQL Server database


SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name LIKE '%DocumentID%'
ORDER BY schema_name, table_name;

Wednesday, October 3, 2012

Sorting a Dictionary via a list


Sample of sorting a dictionary


  Dictionary dictionary = new Dictionary();
            dictionary.Add(0,"cat");
            dictionary.Add(1,"dog");
            dictionary.Add(2,"Tiger");
            dictionary.Add(3,"Rat");
           
            //// Sort the dictionary
            List> result = new List>(dictionary);
            result.Sort(delegate(KeyValuePair first, KeyValuePair second) 
            {
                return first.Value.CompareTo(second.Value);
            });

Monday, March 19, 2012

History vs Aliens

There are wonderful and curios couple of videos on history channel. It is all about the unimaginable creations of history.

Sunday, February 19, 2012

ASP.NET Inline coding

http://weblogs.asp.net/ahmedmoosa/archive/2010/10/06/embedded-code-and-inline-server-tags.aspx

Tuesday, May 10, 2011

Entrypting SQL server database 2005

http://blogs.microsoft.co.il/blogs/applisec/archive/2008/06/15/microsoft-sql-server-2005-database-encryption-step-by-step.aspx