Tag Archives: Tips

TIP: How to get named colors in Silverlight

As of now, Silverlight does not support Color.FromName.  We need to hardcode all the colors in to a helper class (or extension) and use the same for creating brushes. You can use the following code to get colors from names … Continue reading

Posted in Silverlight/WPF | Tagged , | Leave a comment

Tip: How to anonymously access WCF Service available in another domain

Imagine the situation is like the following: You developed WCF Service using “wsHttpBinding” You hosted in IIS on a different domain (or computer/network) You wanted to access/consume the WCF Service from another domain (or computer/network) You don’t want to implement … Continue reading

Posted in WCF | Tagged , | 18 Comments

Tip: Generating iCalender file using ASP.NET

  iCalender is something like an open format text file to add items to the calendar (like Outlook calendar).  It is simply a text file which contains fields and information about the particular event of a calendar.  Once you double … Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

TIP: Viewing the generated SQL of LINQ statements

Even though LINQ uses the familar syntax as of SQL, it is not the same SQL generated at run-time.  To view the SQL generated from LINQ, we can use "Log" property of "DataContext" in the following manner:                 Dim obj … Continue reading

Posted in LINQ/EF | Tagged , , | Leave a comment

TIP: Modifying Connection String dynamically for a strongly typed dataset in a different assembly

Imagine, I am working on a Visual Studio 2005/2008 solution with class library project (DAL) and Web Application Project (ASP.NET).  Say, the DAL is being developed using Dataset Designer with different Strongly Typed DataSets/DataTables together with TableAdapters.  Then I would … Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

TIP: Writing a macro in Visual Studio 2005 to attach a process for debugging purposes

For debugging class libraries, web services etc., we may need to attach the debugger to a running ASP.NET process.  It is better to write a macro to accomplish the above and use it for any number of times using a … Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

Opening a Popup and refreshing parent (when closed) using ASP.NET

The following is the source code which demonstrates the opening of a popup (from gridview), adding/editing a record in popup and finally refresh the parent window upon closing the popup using ASP.NET:     http://cid-41050f68f010a662.skydrive.live.com/embedrowdetail.aspx/Public/SourceFilesForBlog/Misc/PopupTest.zip   thanks Jag

Posted in ASP.NET | Tagged , | Leave a comment

TIP: Open popup when clicked on a hyperlink in GridView: Part-2

Part – 2 of previous Post:   Part – 1 is here: http://jagchat.spaces.live.com/blog/cns!41050F68F010A662!841.entry   ——– UPDATE: Page refresh upon closing a popup is published here (along with source code) http://jagchat.spaces.live.com/blog/cns!41050F68F010A662!1184.entry  ——–   The Employee class got coded as following:   Imports … Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

TIP: Open Popup when clicked on a hyperlink in GridView: Part-1

This is a small tip which demonstrates the functionality to open a popup (with details page) when the user clicks on any link in a particular column of GridView.  Part-1 contains code for default.aspx and Part-2 (next post) contains the rest … Continue reading

Posted in ASP.NET | Tagged , | Leave a comment

TIP: Executing Anoynymous Transact-SQL blocks from .NET

Following is the sample code which executes a Transact-SQL anonymous block dynamically using .NET:   Public Shared Function GetValueFromAnoymousBlock() As String     Dim s As String     s = "DECLARE @x int" & ControlChars.NewLine     s &= "DECLARE @y int" … Continue reading

Posted in VB.NET | Tagged , | Leave a comment