Wednesday, December 16, 2009

Is it the same for everybody ?




Something to think..
Thought how true that is.... and will be....

Thursday, December 3, 2009

For Future Reference


The most common answer to this problem is to go to the Data menu and choose Show Data Sources. This option does not appear for me.
The Show Report Data Pane keyboard shortcut did work for me: CTRL+ALT+D. There is nothing in the menus that I could find that does this same thing.

WeakReference Class
http://msdn.microsoft.com/en-us/library/system.weakreference.aspx





Caching Dynamically Created Images
private void writeContent(HttpContext context, byte[] content, string contentType)
{

context.Response.Cache.SetExpires(DateTime.Now.AddMinutes(60));
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetValidUntilExpires(false);

context.Response.ContentType = contentType;
context.Response.BinaryWrite(content);
}

Use this SP when you need to find all the SP Names which contains a certain term :

e.g if i need to search for the term 'orders', the following will return all the SPs which contains it

declare @SearchTerm varchar(50)
SET @SearchTerm = 'orders'

SELECT
ROUTINE_NAME,
ROUTINE_DEFINITION
FROM
INFORMATION_SCHEMA.ROUTINES
WHERE
ROUTINE_DEFINITION LIKE '%' + @SearchTerm + '%'
ORDER BY
ROUTINE_NAME

Copy Data Between DB Tables:

INSERT INTO [DBDestination].[dbo].[TableA]([Col1],[Col2],[Col3],[Col4],[Col5],[Col6])

SELECT [Col1],[Col2],[Col3],[Col4],[Col5],[Col6]
FROM [DBSource].[dbo].[TableA]