Wednesday, April 20, 2011

linqpad

 

LINQPad is a free software utility for Microsoft .NET developers using LINQ. It allows developers to interactively query SQL databases and other data sources such WCF Data Services using LINQ.

LINQPad supports the following LINQ dialects:

  • LINQ to Objects
  • LINQ to SQL
  • Entity Framework
  • LINQ to XML


It also supports writing queries in SQL as well.

Aside from being useful for writing queries, LINQPad can be used to interactively write C# code without having to compile it. This expands its use to a general "test workbench" where C# code can be quickly prototyped outside of Visual Studio.

download linqpad

Monday, April 11, 2011

Find Text within all stored procedures

 

select * from INFORMATION_SCHEMA.ROUTINES
Where ROUTINE_DEFINITION like '%searchstring%'

The following statement will search all stored proc in database containing the name ‘aspnet_Membership

select * from INFORMATION_SCHEMA.ROUTINES
Where ROUTINE_DEFINITION like '%aspnet_Membership_%'

image

following statement will search a text inside the stored procedure

select * from INFORMATION_SCHEMA.ROUTINES
Where ROUTINE_DEFINITION like '%INNER JOIN aspnet_UsersInRoles UR%'

 

image

NPOI

 

This project is the .NET version of POI Java project at http://poi.apache.org/. POI is an open source project which can help you read/write xls, doc, ppt files. It has a wide application.

For example, you can use it to generate a Excel report without Microsoft Office suite installed on your server and more efficient than call Microsoft Excel ActiveX at background; you can also use it to extract text from Office documents to help you implement full-text indexing feature (most of time this feature is used to create search engines).

more info

Monday, April 04, 2011

NuGet

 

NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.

When you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left.

more info

Sunday, April 03, 2011

Explicitly Implementing Interface

 

Explicit implementation can be helpful when class implements interfaces having save method signatures

interface IAgency
    {
        void AddUpdate();
    }
    interface IPackage
    {
        void AddUpdate();
    }
    class Travel : IAgency, IPackage
    {
        public void AddUpdate()
        {
        }
    }


By Implementing Interfaces explicitly we can avoid the above problem



interface IAgency
{ 
    void AddUpdate();    
}
interface IPackage
{ 
  void AddUpdate();    
}
class Travel : IAgency,IPackage
    {
        
        void IAgency.AddUpdate()
        {
            throw new NotImplementedException();
        }
        void IPackage.AddUpdate()
        {
            throw new NotImplementedException();
        }
}


Travel obj = new Travel();
//obj.AddUpdate();  // Compiler error.
IAgency objAgency = (IAgency)obj;
objAgency.AddUpdate();  // Calls IAgency.AddUpdate on Travel 
IPackage objPackage = (IPackage)obj;
objPackage.AddUpdate(); // Calls IPackage.AddUpdate on Travel 

Friday, April 01, 2011

Code Analysis, Team Standards, Unit Testing, Code Coverage and Profiling for .NET

CodeIt.Right provides a fast, automated way to ensure that your source code adheres to (your) predefined design and style guidelines as well as best coding practices. We take static code analysis to the next level by enabling rule violations to be automatically refactored into conforming code. CodeIt.Right helps to improve your software quality, ensure code correctness, find issues early and resolve them quickly. Whether you are starting a new project or maintaining existing product, CodeIt.Right is the right choice!

 

TestMatrix helps you improve the quality of your code by making test driven development painless and convenient. TestMatrix adds support for unit testing, code coverage analysis, and test profiling to Visual Studio, seamlessly incorporating these critical development practices directly into the coding process itself.

 

GhostDoc is a free Visual Studio extension that automatically generates XML documentation comments for methods and properties based on their type, parameters, name, and other contextual information.

 

PrettyCode.Print for .NET Produce professionally styled color coded printouts of .NET source code. Create your own style for all your project documentation. Once you've defined your own settings, everything you print will look consistent and professional - the way you want it.

Wednesday, March 04, 2009

Exploring Assembly in .NET

The Intermediate Language Disassembler (ildasm.exe),which comes with the .NET SDK allows to view a dll contents,manifest CIL code and Metadata…

ildasm can be loaded from command prompt(start –> Programs –> Microsoft Visual Studio 2008 – > Visual Studio 2008 Command Prompt

for demonstration i have developed a class with contains a method for getting the TotalPrice

  





   1: using System;


   2: using System.Collections.Generic;


   3: using System.Linq;


   4: using System.Web;


   5:  


   6: namespace www.buddhasmiles.blogspot.com


   7: {


   8:     public class buddha_class


   9:     {


  10:         public decimal GetTotalPrice()


  11:         {


  12:             decimal grandTotalPrice = 0, itemTotalPrice = 0, itemDiscountedTotalPrice = 0, itemTotalPriceCommodtity = 0;


  13:  


  14:             itemDiscountedTotalPrice = Convert.ToDecimal("100");


  15:             grandTotalPrice += itemDiscountedTotalPrice;


  16:  


  17:             return grandTotalPrice;


  18:         }


  19:  


  20:     }


  21: }




i open the dll using the ildasm and here is the output



image



for viewing the CIL just double click each method



Lutz Roeder’s Reflector( http://www.aisto.com/roeder/dotnet.)



Another free tool similar like ildasm …a great s/w where we can see the code in multiple languages



image

Thursday, November 06, 2008

Watir

Watir stands for “Web Application Testing in Ruby”. It is pronounced water.

Watir is an open-source library for automating web browsers. It allows you to write tests that are easy to read and maintain. It is simple and flexible.

Watir drives browsers the same way people do. It clicks links, fills in forms, presses buttons. Watir also checks results, such as whether expected text appears on the page.

Watir is a family of Ruby libraries. They support Internet Explorer on Windows, Firefox on Windows, Mac and Linux, and Safari on Mac.

more info

Tuesday, August 05, 2008

Integrating Telephony Services into .NET Applications

Learn how developers using Microsoft .NET framework can use SIP Objects.NET to gain simple and flexible access to telephony networks. SIP Objects.NET enables developers to access a wide variety of enterprise or traditional carrier networks by leveraging technologies such as Avayas SIP Application Server.

more info

Monday, March 24, 2008

Google AJAX Language API

What is the Google AJAX Language API?

With the AJAX Language API, you can translate and detect the language of blocks of text within a webpage using only Javascript.

more info

Monday, March 17, 2008

Android

Android is a software stack for mobile devices that includes an operating system, middleware and key applications. This early look at the Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.

 

http://code.google.com/android/what-is-android.html

http://www.helloandroid.com/node/258

Song Bird- Play music. Play the Web.

     

Songbird is a desktop media player mashed-up with the Web. Songbird is committed to playing the music you want, from the sites you want, on the devices you want, challenging the conventions of discovery, purchase, consumption and organization of music on the Internet.

Songbird is a player and a platform. Like Firefox, Songbird is an open source, Open Web project built on the Mozilla platform. Songbird provides a public playground for Web media mash-ups by providing developers with both desktop and Web APIs, developer resources and fostering Open Web media standards, to wit, an Open Media Web.

 

more info

SQL Prompt™ Latest version: 3.6.0 Intelligent code completion for SQL Server

 

SQL Prompt automates the retrieval of database object names, syntax and snippets as you write, intelligently offering only appropriate code choices. In addition to displaying the object creation-SQL script, SQL Prompt is highly customizable so you can make it perform exactly the way you want.

Using SQL Prompt will improve your productivity and dramatically reduce your time at the keyboard. See the animation below displaying a typical scripting event and how much effort and time SQL Prompt can save you.

more info

Friday, March 14, 2008

Detect application launched from command window

recently one in experts -exchange asked me how to detect application launched from command window.

 


   1: static void Main(string[] args)
   2: {
   3:     foreach (string arg in args)
   4:     {
   5:  
   6:         MessageBox.Show(arg);
   7:  
   8:     }
   9:  
  10:     Application.EnableVisualStyles();
  11:     Application.SetCompatibleTextRenderingDefault(false);
  12:     Application.Run(new Form1());
  13:  
  14:  
  15:    
  16: }

 


image


pass the parameters from the command window..this feature can be used to load the program based on various environment settings

Tuesday, March 11, 2008

BlackBerry Plug-in for Microsoft Visual Studio

BlackBerry® offers leading wireless solutions, providing access to a wide range of applications on a variety of BlackBerry smartphones, as well as BlackBerry enabled devices around the world. BlackBerry wireless solutions combine wireless devices with software and services to keep mobile professionals connected to the people, data and resources that drive their day.

 

BlackBerry Plug-in for Microsoft Visual Studio

The BlackBerry® Plug-in for Microsoft® Visual Studio® allows enterprise developers and system integrators to leverage existing Microsoft® based developer tools to wirelessly enable applications for BlackBerry® smartphones. It lets developers working within a .NET programming environment use their development tool of choice, while still taking advantage of the benefits of the BlackBerry® Mobile Data System (BlackBerry MDS). They can enjoy simplified wireless application development, deployment and management for the enterprise.

more info

Thursday, March 06, 2008

COALESCE() accepts a series of values and a value to use in the event that all items in the list are null; then, it returns the first not-null value. This tip describes two creative uses of the COALESCE() function in SQL Server.

this functionis very much usefull in building a comma seprated strings which i used in my project

i used this functions to get all the id's based on a common value




declare @oid varchar(8000)

SELECT @oid = COALESCE(@oid +',', '') +convert(varchar(1000),ConsumerOrderids )
from ConsumerOrderInfowhere consumerid = 124

select @orderdetailsid


the output was
1001,1002,1003

Sunday, November 25, 2007

Microsoft Popfly

 

Popfly is the fun and easy way to build and share mashups, gadgets, and Web pages. It’s made up of online visual tools for building Web pages and mashups and a social network where you can host, share, rate, comment and even remix creations from other Popfly users.

Add some fun to your Facebook page, web site, or Windows Live Spaces page. You can easily spice up your Web site or blog with Popfly by adding customized games like Whack-a-mole or asteroids with pictures of your friends and family or create custom quizzes or polls that you can easily embed on your Web site.

Build a home page. You can build a custom home page, say for your school’s sports team and choose from over 150 different themes, 10 styles, and 30 unique color themes for a unique visual design. You can then easily add things like team photos, a team schedule from an RSS feed, video from previous games, Virtual Earth maps with directions to game locations and more, all without writing code.

Mix and re-mix photos and videos. Popfly makes it easy to create and share beautiful slideshows using pictures from Flickr, Windows Live Spaces, Facebook or to embed a podcast or a video player hosting videos from Soapbox or YouTube and share it on your Facebook profile, Windows Live Spaces page, or any Web page.

Unify your online personality. Popfly enables you to customize and stitch together your online persona in one place. You can create mashups that show what you dug on Digg.com, what you are buying or selling on eBay, you Halo 3 game scores, what Facebook events you’re attending, what your friends are doing on Twitter, and much more. 

In addition, Popfly offers a powerful web programming environment and social network so you can bring in new data sources, create new ways to display information, or even create and share full Visual Studio projects.

Tuesday, November 20, 2007

Selecting a single radio button inside a grid view

the below code will explain how to change your code for selecting a single radio button inside a grid view.

by default we can select multiple radio buttons inside a grid view.to make it a single selection we need to add a script..

below code explain that


  1 <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID" DataMember="DefaultView" DataSourceID="SqlDataSource1"> 
  2 <Columns> 
  3 <asp:TemplateField> 
  4 <ItemTemplate> 
  5 <input type="radio" runat="server" id="rdOption" onclick="SelectOne(this,'GridView1')"  VALUE="rdo" /> 
  6 </ItemTemplate> 
  7 <HeaderStyle CssClass="Head" /> 
  8 <ItemStyle CssClass="Item" />
  9 </asp:TemplateField> 
 10
 11 <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" > 
 12 <HeaderStyle CssClass="Head" /> 
 13 <ItemStyle CssClass="Item" /> 
 14 </asp:BoundField> 
 15
 16 <asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" > 
 17 <ItemStyle CssClass="Item" /> 
 18 <HeaderStyle CssClass="Head" /> 
 19 </asp:BoundField> 
 20 </Columns> 
 21 </asp:GridView>


add the following javascript

  1 <script language="javascript"> 
  2
  3 function SelectOne(rdo,gridName) 
  4 { 
  5    all=document.getElementsByTagName("input"); 
  6    for(i=0;i<all.length;i++) 
  7    { 
  8      if(all[i].type=="radio") 
  9      { 
 10         var count=all[i].name.indexOf(gridName+'$ctl' ); 
 11         if(count!=-1) 
 12         { 
 13            all[i].checked=false; 
 14         } 
 15       } 
 16     } 
 17    rdo.checked=true; 
 18 } 
 19 </script>


the Script will be called in the on click event of the radio button in the grid

Monday, October 01, 2007

The Write Less, Do More, JavaScript Library..Jquery



jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.

What jQuery Does

The jQuery library provides a general-purpose abstraction layer for common web scripting, and is therefore useful in almost every scripting situation. Its extensible nature means that we could never cover all possible uses and functions in a single book, as plug-ins are constantly being developed to add new abilities.

The core features, though, address the following needs:

1.Access parts of a page.

2.Modify the appearance of a page.

3.Alter the content of a page.

4.Respond to a user's interaction with a page.

5.Add animation to a page

6.Retrieve information from a server without refreshing a page.
(AJAX)

7.Simplify common JavaScript tasks.

more info -

http://jquery.com/
http://15daysofjquery.com/
http://jquery.com/blog/

Monday, September 24, 2007

Developer Extension To Mozilla

The Web Developer extension adds a menu and a toolbar to the browser with various web developer tools. It is designed for Firefox, Flock, Mozilla and Seamonkey, and will run on any platform that these browsers support including Windows, Mac OS X and Linux.