Archive

Archive for May, 2010

C# Get Copyright information from current application using Reflection

May 28th, 2010 No comments

Here is the code snippet:

private string GetCopyright()
{
	Assembly asm = Assembly.GetExecutingAssembly();
	object[] obj = asm.GetCustomAttributes(false);
	foreach (object o in obj)
	{
		if (o.GetType() ==  
			typeof(System.Reflection.AssemblyCopyrightAttribute))
                {
                    AssemblyCopyrightAttribute aca = 
			(AssemblyCopyrightAttribute) o;
                    return aca.Copyright;
                }	
	}
        return string.Empty;
}

Make sure you import namespace: System.Reflection.

VN:F [1.9.18_1163]
Rating: 5.0/5 (3 votes cast)
Categories: C#, Code Snippets

Microsoft MVP Certification – a myth

May 28th, 2010 No comments

Here is a scrap from the official website of one the IT company with 250+ employees. Funny that this company is a Microsoft Gold Certified Partner:

image

It is very unfortunate that people consider Microsoft MVP Award as a “certification”. Fact is:

1 Microsoft MVP badge is an Award given by Microsoft as a recognition for their Technical Expertise, Knowledge Sharing mentality, Community Activities etc.
2 You cannot purchase this with money.
3 It may not be impossible, but it is difficult to get ‘many’ Microsoft MVPs in a company as the total number of Microsoft MVPs in the whole world is very less. In India, we have only around 115 Microsoft MVPs.
4 MVP = Most Valuable Professional, where as MCP = Microsoft Certified Professional.
5 To get a certification, you need to write examination. Today, it is easy to get a certification as there are brain dumps available over the internet. But to get become an MVP, you really need to spend time for technology.

 

See, here is the what Microsoft say about Microsoft MVP Award:

We seek to recognize the best and brightest from technology communities around the world with the Microsoft® Most Valuable Professional (MVP) Award.

These exceptional community leaders come from a wide range of backgrounds. They are teachers, artists, doctors, engineers, as well as technologists, who actively share their high-quality, real-world technical expertise with the community and with Microsoft.

With the MVP Award, we thank these inspiring individuals for representing the voice of thousands in the community through the powerful and independent feedback they give us, and for helping our customers maximize the potential of their software.

MVPs are passionate about improving technology. From beta testing to helping Microsoft identify real-world customer needs, MVPs offer amazing contributions with great dedication. And they answer millions of questions each year from technology users around the world. Through all of this, MVPs help keep us in touch with the needs of our customers. With the MVP Award, we say “Thank you.”

These exceptional and highly respected individuals come from more than 90 countries, serving their local online and offline communities and having an impact worldwide. Not only independent experts offering real-world answers to technology users, MVPs also offer an objective “voice of the customer” perspective for us at Microsoft.

image

Here are few links to know more:

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: General

Some interview points for your .NET interview

May 27th, 2010 No comments

Make sure you tried to cover all these points before you appear for a .NET technical round.

OOPs

  • General Concepts
  • OOPs with .NET languages

.NET

  • What is Framework
  • Roles/Responsibilities/Functions of CLR
  • Latest Framework Version?
  • Major differences between 1.1 & 2.0 & 3.5 & 4.0
  • What is new in 3.5
  • What is new in 4.0
  • Visual Studio Version?
  • Terminology:
  • Strong Naming,
  • Assembly Signing,
  • Caspol,
  • Strong Key,
  • Type Safety
  • Interface, Delegate, Events
  • What is LINQ?
  • Serialization

ADO.NET

  • How to connect from .NET language to:
  • MS SQL Server, Oracle, MySQL
  • What is LINQ to SQL?

ASP.NET

  • Page Life Cycle
  • HTTP Handlers
  • HTTP Modules
  • ASP.NET AJAX
  • User Controls
  • Deployment of ASP.NET Websites
  • Difference between Web Application and Web Site
  • Third-party Libraries: JQuery, Infragistics, DevExpress etc.

WCF

  • Difference between Web Service & WCF Service
  • Merits over Web Service
  • Different Contracts available
  • How will you send and receive bigger files

SQL Server

  • Indexing
  • Difference – table variable & temperory table
  • Various triggers
  • Latest SQL Server version
  • Difference between 2000, 2005 & 2008
  • What is SSIS, SSRS, SSAS
  • What is SQL Job
  • Demerits of CURSOR
  • Send mail from T-SQL/Stored Procedure
  • Relationships – n:n, 1:1, 1:n etc.
  • Keys – primary, unique, foreign etc.
  • Performance monitoring methods – SQL Profier etc.

General

  • Design Patterns
  • What is design pattern?
  • Singleton
  • Façade
  • Factory
  • Command etc.
  • How will you send mail from .NET
  • Patterns & Practices
  • What is enterprise library?
  • Which are the application blocks available
  • What is MSF
  • What software development methodology you use?
  • What is waterfall?
  • What is agile?
  • What is scrum?
  • Setup Project
  • Architectures: 3-Tier, N-Tier, MVC, MVP etc.

SharePoint

  • Features of SharePoint
  • Difference between WSS & MOSS
  • WebParts
  • Pages
  • Lists
  • Deployment
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: DOTNET, General

Show jquery imprompu popup from ASP.NET-AJAX

May 27th, 2010 No comments

Simple :)

	ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "message", 
		"$.prompt('Are you sure?')", true);
VN:F [1.9.18_1163]
Rating: 5.0/5 (1 vote cast)
Categories: C#, Code Snippets

WinForms – Print using printDialog and printDocument

May 27th, 2010 No comments

Code snippet here:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        DataSet ds = new DataSet();
        public Form1()
        {
            InitializeComponent();
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            printDialog1.Document = printDocument1;
            if (printDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                printDocument1.Print();
            }
        }
 
        private void printDocument1_PrintPage(object sender, 
		System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString("test",new Font(FontFamily.GenericSerif,12),
			Brushes.Black,100,100);
        }
    }
}
VN:F [1.9.18_1163]
Rating: 3.7/5 (3 votes cast)
Categories: C#, Code Snippets, DOTNET

Filter Listbox based on Textbox entry

May 27th, 2010 No comments

Here is the C# code:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        DataSet ds = new DataSet();
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            // sample data
 
            ds.ReadXml(@"C:\mypath\customers.xml");
 
	   // initial customers list
	   // since the textbox is empty, it will show all the customers
            ShowCustomers(ds.Tables[0], textBox1.Text);
 
 
        }
 
        private void ShowCustomers(DataTable odt, string filter)
        {
	    // need to copy the exact schema for temperory datatable
            DataTable dt = odt.Clone(); 
            foreach (DataRow dr in odt.Select("Label like '" + filter + "%'"))
            {
                dt.ImportRow(dr);
 
            }
 
            listBox1.DataSource = dt;
            listBox1.DisplayMember = "Label";
            listBox1.ValueMember = "Value";
 
        }
 
        private void textBox1_KeyUp(object sender, KeyEventArgs e)
        {
            ShowCustomers(ds.Tables[0], textBox1.Text);
        }
    }
}
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: C#, Code Snippets

Find technical details about the domain name

May 21st, 2010 No comments

Just got this link – http://builtwith.com/

This can give you information like:

  • Server – Apache/IIS etc.
  • OS
  • Analytics
  • JavaScript Libraries
  • CMS name
  • Language/Framework etc.
VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: General

Causes of Project Failure

May 21st, 2010 No comments

Just gone through Anish Mathai Mathew’s post on project failure reasons and thought to reply there but I think due to some  technical issues I was not able to post anything on that website. So I thought to post it here:

Answers based on my experience.

#1. Lacking Sponsor’s Involvement/Ownership
>> Indeed. But again, you must be a solution provider and should not be waiting for your cusomer to explain the requirements. It must be your job to tell him ‘what he want!’.

#2. Halo Effect (Wrong Man for the Job)
>> Agreed

#3. Poor HR Management
>> I agree – assuming, it have connection wit #2. Otherwise disagreed.

#4. Poor/Inadequate Project Communications
>> Agreed 100%. Communication! yea, communication, communication and communication

#5. Ignoring Project Stakeholders
>> Agreed, but would like to rename it to ‘Proper Project Management’

#6. Absence of Risk Management
>> Again, something to do with ‘Proper Project Management’

#7. Scope Creep/Unrealistic Expectations
>> Disagreed, as this can be rectified at the initial stages of project planning. Someting to do with ‘Proper Project Management’

#8. Lack of Monitoring of Plan
>> Agreed, again – ‘Proper Project Management’

#9. Absence of a Project Management Methodology
>> 50%. A properly defined ‘methodology’ can only speedup the process. Every projects use some kind of methodology unknownly. We had projects before we invented terms ‘agile’ etc.

#10. Simply BAD LUCK 
>> Disagreed. It is we who decide whether the project need to be a success or failure.

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Project Management

My old program: TaskLister now at SoftPedia

May 13th, 2010 No comments

Just got an email from SoftPedia regarding this. You can download my product from here :)

This product was done with Visual C#

TaskLister screenshot 1

VN:F [1.9.18_1163]
Rating: 4.0/5 (1 vote cast)
Categories: News

Offshore development issues

May 11th, 2010 No comments

Here is a good informative article from CodeProject – http://www.codeproject.com/KB/tips/help.aspx

Another one from the same author – How to convince developers and management to use automated test instead of manual test : http://www.codeproject.com/KB/tips/convince.aspx

VN:F [1.9.18_1163]
Rating: 0.0/5 (0 votes cast)
Categories: Architecture