Tuesday, August 30, 2011

CRM

http://web.iotap.com/Blog/tabid/673/categoryid/4/page/2/Default.aspx
http://akifkamalsyed.wordpress.com/category/ms-dynamics-crm/
http://www.crmsoftwareblog.com/category/crm_software_information/

What is Sharepoint 2010
http://sharepoint.microsoft.com/en-us/product/capabilities/Pages/default.aspx

http://web.iotap.com/Blog/tabid/673/categoryid/4/page/2/Default.aspx
http://akifkamalsyed.wordpress.com/category/ms-dynamics-crm/
http://www.crmsoftwareblog.com/category/crm_software_information/

A Workaround for Custom Workflows in CRM Online 2011 :

http://blogs.inetium.com/blogs/azimmer/archive/2011/03/03/a-workaround-for-custom-workflows-in-crm-online-2011.aspx
http://blogs.inetium.com/blogs/azimmer/archive/2010/01/21/silverlight-applications-in-crm-4-0.aspx


http://web.iotap.com/Blog/tabid/673/categoryid/4/page/2/Default.aspx
http://akifkamalsyed.wordpress.com/category/ms-dynamics-crm/
http://www.crmsoftwareblog.com/category/crm_software_information/

CRM Videos:
http://offers.crmchoice.com/CRM2011Beta-Developer-Videos/

Blogs for CRM
http://blogs.infinite-x.net/2010/12/16/crm-2011-online-why-custom-workflow-assemblies-are-not-supported/

http://jianwang.blogspot.com/

Microsoft Dynamics CRM 2011 Software Development Kit (SDK)

http://www.microsoft.com/download/en/details.aspx?id=24004

TechNet Articles
http://social.technet.microsoft.com/wiki/contents/articles/default.aspx

Hyper-v

http://www.petri.co.il/creating-managing-virtual-servers-windows-server-2008-hyperv.htm

http://www.windowsreference.com/hyper-v/hyper-v-how-to-create-a-new-virtual-machine/

http://blogs.msdn.com/b/ericwhite/archive/2010/12/13/how-to-install-and-activate-the-iw-demo-evaluation-hyper-v-machine.aspx

Using SMTP Sending mail

http://www.directsharepoint.com/2011/03/send-mail-through-code-in-sharepoint.html

http://www.systemnetmail.com/forums/forum.aspx?forum=2
http://thehumblecoder.wordpress.com/2007/01/04/systemnetmail-basic-example/
http://snahta.blogspot.com/2009/05/configuring-smtp-using-webconfig.html

http://digsharepoint.blogspot.com/2011/04/configuring-incoming-email-in.html
http://www.directsharepoint.com/2011/03/send-mail-through-code-in-sharepoint.html
http://digsharepoint.blogspot.com/2011/04/configuring-outgoing-email-in.html

http://www.codeproject.com/Articles/125119/Configuring-Sharepoint-2010-to-Accept-Incoming-Ema
http://www.sharepointology.com/development/how-to-create-alerts-programmatically/

http://www.directsharepoint.com/2011/04/sharepoint-email-configuration-using.html

http://blog.furuknap.net/send-a-sharepoint-document-library-file-as-email

http://www.dev4side.com/community/blog/2010/3/2/send-e-mail-messages-using-sharepoint-smtp.aspx
http://www.aspnetemail.com/Examples.aspx


http://chanakyajayabalan.wordpress.com/2010/12/

http://waelmohamed.wordpress.com/2011/05/31/configure-sharepoint-2010-search-service-application/

http://geekswithblogs.net/Lance/archive/2010/02/17/changing-page-layout-with-sharepoint-designer-2010.aspx



######################################
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.IO;
using System.ComponentModel;
namespace Mail
{
class Program
{
static void Main(string[] args)
{

}
static void PlainText()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
static void HtmlEmail()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body with html in it. This is bold This is blue";
mail.IsBodyHtml = true;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void MultiPartMime()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");
//then we create the Html part
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("this is bold text, and viewable by those mail clients that support html", null, "text/html");
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
smtp.Send(mail);
}

static void FriendlyFromName()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@mycompany.com", "Steve James" );
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

static void FriendlyToName()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@mycompany.com", "Steve James");

//since the To,Cc, and Bcc accept addresses, we can use the same technique as the From address
mail.To.Add( new MailAddress( "you@yourcompany.com", "Beth Jones") );
mail.CC.Add(new MailAddress("donna@yourcompany.com", "Donna Summers"));
mail.Bcc.Add(new MailAddress("bob@yourcompany.com", "Bob Smith"));

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@mycompany.com", "Steve James");

//since the To,Cc, and Bcc accept addresses, we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections, to add multiple addreses, we simply call .Add(...) multple times
mail.To.Add("you@yourcompany.com");
mail.To.Add("you2@yourcompany.com");
mail.CC.Add("cc1@yourcompany.com");
mail.CC.Add("cc2@yourcompany.com");
mail.Bcc.Add("blindcc1@yourcompany.com");
mail.Bcc.Add("blindcc2@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void FriendlyNonAsciiName()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly non ascii name, we use a different ctor.
//A ctor that accepts an encoding that matches the text of the name
mail.From = new MailAddress("me@mycompany.com", "Steve Øbirk", Encoding.GetEncoding( "iso-8859-1"));
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

static void SetPriority()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//specify the priority of the mail message
mail.Priority = MailPriority.High;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void SetTheReplyToHeader()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//specify the priority of the mail message
mail.ReplyTo = new MailAddress("SomeOtherAddress@mycompany.com");

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void CustomHeaders()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//to add custom headers, we use the Headers.Add(...) method to add headers to the
//.Headers collection
mail.Headers.Add("X-Company", "My Company");
mail.Headers.Add("X-Location", "Hong Kong");


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
static void ReadReceipts()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//To request a read receipt, we need add a custom header named 'Disposition-Notification-To'
//in this example, read receipts will go back to 'someaddress@mydomain.com'
//it's important to note that read receipts will only be sent by those mail clients that
//a) support them
//and
//b)have them enabled.
mail.Headers.Add("Disposition-Notification-To", "");


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void AttachmentFromFile()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this content is in the body";

//add an attachment from the filesystem
mail.Attachments.Add(new Attachment("c:\\temp\\example.txt"));

//to add additional attachments, simply call .Add(...) again
mail.Attachments.Add(new Attachment("c:\\temp\\example2.txt"));
mail.Attachments.Add(new Attachment("c:\\temp\\example3.txt"));

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

static void AttachmentFromStream()
{

//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this content is in the body";

//Get some binary data
byte[] data = GetData();

//save the data to a memory stream
MemoryStream ms = new MemoryStream(data);

//create the attachment from a stream. Be sure to name the data with a file and
//media type that is respective of the data
mail.Attachments.Add( new Attachment( ms, "example.txt", "text/plain" ));

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
static byte[] GetData()
{
//this method just returns some binary data.
//it could come from anywhere, such as Sql Server
string s = "this is some text";
byte[] data = Encoding.ASCII.GetBytes(s);
return data;
}

static void LoadFromConfig(){
//the from address, along with the server properties will be set in the app.config,
//thus we don't need to specify them in code

//create the mail message
MailMessage mail = new MailMessage();

mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient();
smtp.Send(mail);

}

static void Authenticate()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new NetworkCredential("username", "secret");
smtp.Send(mail);

}

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

static void EmbedImages()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");

//then we create the Html part
//to embed images, we need to use the prefix 'cid' in the img src value
//the cid value will map to the Content-Id of a Linked resource.
//thus will map to a LinkedResource with a ContentId of 'companylogo'
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is an embedded image.", null, "text/html");

//create the LinkedResource (embedded image)
LinkedResource logo = new LinkedResource( "c:\\temp\\logo.gif" );
logo.ContentId = "companylogo";
//add the LinkedResource to the appropriate view
htmlView.LinkedResources.Add(logo);

//add the views
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
smtp.Send(mail);
}

static void SSL()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//Port 587 is another SMTP port
SmtpClient smtp = new SmtpClient("127.0.01", 587);
smtp.EnableSsl = true;
smtp.Send(mail);
}

static void SendAsync()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
//the userstate can be any object. The object can be accessed in the callback method
//in this example, we will just use the MailMessage object.
object userState = mail;

//wire up the event for when the Async send is completed
smtp.SendCompleted += new SendCompletedEventHandler(SmtpClient_OnCompleted);

smtp.SendAsync( mail, userState );
}
public static void SmtpClient_OnCompleted(object sender, AsyncCompletedEventArgs e)
{
//Get the Original MailMessage object
MailMessage mail= (MailMessage)e.UserState;

//write out the subject
string subject = mail.Subject;

if (e.Cancelled)
{
Console.WriteLine("Send canceled for mail with subject [{0}].", subject);
}
if (e.Error != null)
{
Console.WriteLine("Error {1} occurred when sending mail [{0}] ", subject, e.Error.ToString());
}
else
{
Console.WriteLine("Message [{0}] sent.", subject );
}
}

public static void PickupDirectory()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//if we are using the IIS SMTP Service, we can write the message
//directly to the PickupDirectory, and bypass the Network layer
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
smtp.Send(mail);
}

public static void EmailWebPage()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//screen scrape the html
string html = ScreenScrapeHtml("http://localhost/example.htm");
mail.Body = html;
mail.IsBodyHtml = true;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}
public static string ScreenScrapeHtml(string url)
{
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());
string result = sr.ReadToEnd();
sr.Close();
return result;
}

public static void NonAsciiMail()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//to send non-ascii content, we need to set the encoding that matches the
//string characterset.
//In this example we use the ISO-8859-1 characterset
mail.Body = "this text has some ISO-8859-1 characters: âÒÕÇ";
mail.BodyEncoding = Encoding.GetEncoding("iso-8859-1");

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

public static void InnerExceptions()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("him@hiscompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
try
{
smtp.Send(mail);
}
catch (Exception ex)
{
Exception ex2 = ex;
string errorMessage = string.Empty;
while (ex2 != null)
{
errorMessage += ex2.ToString();
ex2 = ex2.InnerException;
}

Console.WriteLine(errorMessage);
}
}
}
}

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
http://www.wssdemo.com/Lists/Resources/DispForm.aspx?ID=1413&ContentTypeId=0x01005C6956D831EB0B49B4AEE28DF95A058209002B888D2318B6D743B95E0EB2F37D004E

Sending mail code
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Mail;
using System.Net.Mime;
using System.IO;
using System.ComponentModel;
namespace Mail
{
class Program
{
static void Main(string[] args)
{

}
static void PlainText()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
static void HtmlEmail()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body with html in it. This is bold This is blue";
mail.IsBodyHtml = true;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void MultiPartMime()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");
//then we create the Html part
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("this is bold text, and viewable by those mail clients that support html", null, "text/html");
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
smtp.Send(mail);
}

static void FriendlyFromName()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@mycompany.com", "Steve James" );
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

static void FriendlyToName()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@mycompany.com", "Steve James");

//since the To,Cc, and Bcc accept addresses, we can use the same technique as the From address
mail.To.Add( new MailAddress( "you@yourcompany.com", "Beth Jones") );
mail.CC.Add(new MailAddress("donna@yourcompany.com", "Donna Summers"));
mail.Bcc.Add(new MailAddress("bob@yourcompany.com", "Bob Smith"));

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@mycompany.com", "Steve James");

//since the To,Cc, and Bcc accept addresses, we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections, to add multiple addreses, we simply call .Add(...) multple times
mail.To.Add("you@yourcompany.com");
mail.To.Add("you2@yourcompany.com");
mail.CC.Add("cc1@yourcompany.com");
mail.CC.Add("cc2@yourcompany.com");
mail.Bcc.Add("blindcc1@yourcompany.com");
mail.Bcc.Add("blindcc2@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void FriendlyNonAsciiName()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
//to specify a friendly non ascii name, we use a different ctor.
//A ctor that accepts an encoding that matches the text of the name
mail.From = new MailAddress("me@mycompany.com", "Steve Øbirk", Encoding.GetEncoding( "iso-8859-1"));
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

static void SetPriority()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//specify the priority of the mail message
mail.Priority = MailPriority.High;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void SetTheReplyToHeader()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//specify the priority of the mail message
mail.ReplyTo = new MailAddress("SomeOtherAddress@mycompany.com");

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void CustomHeaders()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//to add custom headers, we use the Headers.Add(...) method to add headers to the
//.Headers collection
mail.Headers.Add("X-Company", "My Company");
mail.Headers.Add("X-Location", "Hong Kong");


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
static void ReadReceipts()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//To request a read receipt, we need add a custom header named 'Disposition-Notification-To'
//in this example, read receipts will go back to 'someaddress@mydomain.com'
//it's important to note that read receipts will only be sent by those mail clients that
//a) support them
//and
//b)have them enabled.
mail.Headers.Add("Disposition-Notification-To", "");


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}

static void AttachmentFromFile()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this content is in the body";

//add an attachment from the filesystem
mail.Attachments.Add(new Attachment("c:\\temp\\example.txt"));

//to add additional attachments, simply call .Add(...) again
mail.Attachments.Add(new Attachment("c:\\temp\\example2.txt"));
mail.Attachments.Add(new Attachment("c:\\temp\\example3.txt"));

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

static void AttachmentFromStream()
{

//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this content is in the body";

//Get some binary data
byte[] data = GetData();

//save the data to a memory stream
MemoryStream ms = new MemoryStream(data);

//create the attachment from a stream. Be sure to name the data with a file and
//media type that is respective of the data
mail.Attachments.Add( new Attachment( ms, "example.txt", "text/plain" ));

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
static byte[] GetData()
{
//this method just returns some binary data.
//it could come from anywhere, such as Sql Server
string s = "this is some text";
byte[] data = Encoding.ASCII.GetBytes(s);
return data;
}

static void LoadFromConfig(){
//the from address, along with the server properties will be set in the app.config,
//thus we don't need to specify them in code

//create the mail message
MailMessage mail = new MailMessage();

mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient();
smtp.Send(mail);

}

static void Authenticate()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new NetworkCredential("username", "secret");
smtp.Send(mail);

}

static void ChangePort()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");

//to change the port (default is 25), we set the port property
smtp.Port = 587;
smtp.Send(mail);
}

static void EmbedImages()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//first we create the Plain Text part
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");

//then we create the Html part
//to embed images, we need to use the prefix 'cid' in the img src value
//the cid value will map to the Content-Id of a Linked resource.
//thus will map to a LinkedResource with a ContentId of 'companylogo'
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("Here is an embedded image.", null, "text/html");

//create the LinkedResource (embedded image)
LinkedResource logo = new LinkedResource( "c:\\temp\\logo.gif" );
logo.ContentId = "companylogo";
//add the LinkedResource to the appropriate view
htmlView.LinkedResources.Add(logo);

//add the views
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);


//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
smtp.Send(mail);
}

static void SSL()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//Port 587 is another SMTP port
SmtpClient smtp = new SmtpClient("127.0.01", 587);
smtp.EnableSsl = true;
smtp.Send(mail);
}

static void SendAsync()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address
//the userstate can be any object. The object can be accessed in the callback method
//in this example, we will just use the MailMessage object.
object userState = mail;

//wire up the event for when the Async send is completed
smtp.SendCompleted += new SendCompletedEventHandler(SmtpClient_OnCompleted);

smtp.SendAsync( mail, userState );
}
public static void SmtpClient_OnCompleted(object sender, AsyncCompletedEventArgs e)
{
//Get the Original MailMessage object
MailMessage mail= (MailMessage)e.UserState;

//write out the subject
string subject = mail.Subject;

if (e.Cancelled)
{
Console.WriteLine("Send canceled for mail with subject [{0}].", subject);
}
if (e.Error != null)
{
Console.WriteLine("Error {1} occurred when sending mail [{0}] ", subject, e.Error.ToString());
}
else
{
Console.WriteLine("Message [{0}] sent.", subject );
}
}

public static void PickupDirectory()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//if we are using the IIS SMTP Service, we can write the message
//directly to the PickupDirectory, and bypass the Network layer
SmtpClient smtp = new SmtpClient();
smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
smtp.Send(mail);
}

public static void EmailWebPage()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//screen scrape the html
string html = ScreenScrapeHtml("http://localhost/example.htm");
mail.Body = html;
mail.IsBodyHtml = true;

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}
public static string ScreenScrapeHtml(string url)
{
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
StreamReader sr = new StreamReader(objRequest.GetResponse().GetResponseStream());
string result = sr.ReadToEnd();
sr.Close();
return result;
}

public static void NonAsciiMail()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");

//set the content
mail.Subject = "This is an email";

//to send non-ascii content, we need to set the encoding that matches the
//string characterset.
//In this example we use the ISO-8859-1 characterset
mail.Body = "this text has some ISO-8859-1 characters: âÒÕÇ";
mail.BodyEncoding = Encoding.GetEncoding("iso-8859-1");

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);

}

public static void InnerExceptions()
{
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("him@hiscompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";

//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
try
{
smtp.Send(mail);
}
catch (Exception ex)
{
Exception ex2 = ex;
string errorMessage = string.Empty;
while (ex2 != null)
{
errorMessage += ex2.ToString();
ex2 = ex2.InnerException;
}

Console.WriteLine(errorMessage);
}
*******************

private void SendMail()
{
bool success = false;
try
{
SPSite spSite = new SPSite("http://shng021");

SPWeb web = spSite.OpenWeb();


if (web == null)
{
Response.Write("web is null");
}
string toField = "Kurtis.WEN@cognizant.com";
string subject = "Test Message";
string body = "Message sent from SharePoint";
HttpContext context = HttpContext.Current;
HttpContext.Current = null;
success = SPUtility.SendEmail(web, true, true, toField, subject, body);
HttpContext.Current = context;
}
catch (Exception ex)
{
Response.Write(ex);
// handle exception
}
return success;

}
************************************************************
http://www.learningsharepoint.com/2010/08/10/programatically-send-e-mail-in-sharepoint-2010/


}
}
}

SQL SERVER 2008

http://blogs.msdn.com/b/bethmassi/archive/2011/02/18/step-by-step-installing-sql-server-management-studio-2008-express-after-visual-studio-2010.aspx

Storing and Retrieving Image in SQL Server

http://chiragrdarji.wordpress.com/2007/03/05/storing-and-retrieving-image-in-sql-server/
Creating Stored Procedures and User-Defined Functions with Managed Code

http://www.asp.net/data-access/tutorials/creating-stored-procedures-and-user-defined-functions-with-managed-code-cs

Rapid Application Development Using InfoPath and BCS – Part


http://blogs.msdn.com/b/sharepointdev/archive/2011/07/26/rapid-application-development-using-infopath-and-bcs-part-2-anweshi-deverasetty.aspx

***************************************************************
Stored procedure.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Stored Procedure Test.aspx.cs" Inherits="Stored_Procedure_Test" %>












































Stored procedure.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class Stored_Procedure_Test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection sqlConnection = new SqlConnection("Data Source = 110.291.58.20;Failover Partner=crmdb; Initial Catalog =DEV_MSCRM;User Id=crma;password=password");

try
{
// string SpName;

DataSet ds = new DataSet();

sqlConnection.Open();

SqlCommand sqlcommand = new SqlCommand( "udsp_GetOppRelatedUsers" , sqlConnection);
//sqlcommand.CommandText = "SpName";
sqlcommand.CommandType = CommandType.StoredProcedure;
sqlcommand.Parameters.Add("@opportunityId", SqlDbType.VarChar, 50);
sqlcommand.Parameters["@opporId"].Value = "DA9BED-EB69-DE11-BBF4-000E0C440577";
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = sqlcommand;
da.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
TextBox1.Text = ds.Tables[0].Rows[10][1].ToString();
Response.Write(sqlConnection.State.ToString());
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
finally
{
sqlConnection.Close();
}
}
protected void Button2_Click(object sender, EventArgs e)
{
string sqlstr = "Data Source =50.2051.185.25;Failover Partner=crmdb; Initial Catalog =DEV_MSCRM;User Id=cra;password=password";
SqlConnection sqlConnection = new SqlConnection(sqlstr);
try
{
// string SpName;
DataSet ds = new DataSet();
sqlConnection.Open();
SqlCommand sqlcommand = new SqlCommand("udsp_GetOppRelatedUsers", sqlConnection);
//sqlcommand.CommandText = "SpName";
sqlcommand.CommandType = CommandType.StoredProcedure;
sqlcommand.Parameters.Add("@opportId", SqlDbType.VarChar, 50);
sqlcommand.Parameters["@opportId"].Value = "5D4EB3AD-751D-DD11-94A3-000E0C440405";
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = sqlcommand;
da.Fill(ds);
GridView2.DataSource = ds;
GridView2.DataBind();
Response.Write(sqlConnection.State.ToString());
// TextBox1.Text = ds.Tables[0].Rows.Count.ToString();
}
catch (Exception ex)
{
Response.Write(sqlstr +"\t\t"+ ex.Message);
}
finally
{
sqlConnection.Close();
}
}
public void addusers(int i)
{
try
{
SqlConnection sqlConnection = new SqlConnection("Data Source = dev;Failover Partner=tracb; Initial Catalog =MSCRM_CUSTOM;User Id=ADmin;password=password@");
sqlConnection.Open();
SqlCommand sqlcommand = new SqlCommand("udsp_GetOppRelatedUsers", sqlConnection);
//sqlcommand.CommandText = "SpName";
sqlcommand.CommandType = CommandType.StoredProcedure;
sqlcommand.Parameters.Add("@opportunityId", SqlDbType.VarChar, 50);
sqlcommand.Parameters["@opportunityId"].Value = "5D4EB3AD-751D-DD11-94A3-000E0C440405";
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = sqlcommand;
DataSet ds = new DataSet();
da.Fill(ds);

//// usr.LoginName = crmloginuser(userGuid);
//for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) //{ // string s = "HELLO" + Label2.Text; // usr.LoginName = s + ds.Tables[0].Rows[i][1].ToString(); // string strtitle = grps[0].Title; // grpuser.Users.Add(usr); // ctx.ExecuteQuery(); //} } catch (Exception Ex) { } } } **************************** Interview Question: Difference Between GETDATE and SYSDATETIME
When we use GETDATE the precision is till miliseconds and in case of SYSDATETIME the precision is till nanoseconds.
What do you mean by SQL Posting
we can say Posting is an events that helps to writes Inserts,Updates and Deletes in the forms to the database but not commit this transaction to the databases.
What is Filtered Index in SQL
This index is used when we have to index some of rows in table this helps to increase performance and also reduce cost done by index on all the rows.When we see an Index created with some where clause then that is actually a FILTERED INDEX.
What is Linked Server in SQL Server
Linked Servers is SQL Server concept by we can add more SQL Server to a Group and query both the SQL Server dbs usig TSQL Statements. With the help of linked server we can create very fresh,clean, easy to follow, SQL statements that allow remote data to be retrieved, joined and combined with local data. These two Stored Procedure sp_addlinkedserver, sp_addlinkedsrvlogin will be used add new Linked Server.
Define some facts about Temporary table and there types
Temporary table name is limited t 116 characters. Local temporary table created with single # and then name of table. And this table is to be deleted explicitly and if it is created in store procedure it will be dropped at the end of store procedure. On the other hand if are talking abut Global variable tables start with ## and these are dropped on the session ends. And some more facts about the Temporary tables is that these cannot be partitioned and we c
annot create key constraints to these tables and one more thing is that we cannot create user-defined data types in tempdb.

How to get number of Maximum connection can be establish to SQL
select @@MAX_Connections
Why we use Unicode In Sql server
Unicode data is stored using the nchar, nvarchar,and ntext data types in SQL Server. Use these data types for columns that store characters from more than one character set. The SQL Server Unicode data types are based on the National Character data types in the SQL-92 standard.
Diffrence between temp table and table variable
1)Temp Tables are created in the SQL Server TEMPDB database and therefore require more IO resources and locking. Table Variables and Derived Tables are created in memory.
(2)Temp Tables will generally perform better for large amounts of data that can be worked on using parallelism whereas Table Variables are best used for small amounts of data (I use a rule of thumb of 100 or less rows) where parallelism would not provide a significant performance improvement.
(3)You cannot use a stored procedure to insert data into a Table Variable or Derived Table. For example, the following will work: INSERT INTO #MyTempTable EXEC dbo.GetPolicies_sp whereas the following will generate an error: INSERT INTO @MyTableVariable EXEC dbo.GetPolicies_sp.
(4)Derived Tables can only be created from a SELECT statement but can be used within an Insert, Update, or Delete statement.
(5) In order of scope endurance, Temp Tables extend the furthest in scope, followed by Table Variables, and finally Derived Tables
What is SQL injection
SQL injection is a security vulnerability that occurs in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.
Write some disadvantage of Cursor
Cursor plays there row quite nicely but although there are some disadvantage of Cursor . Because we know cursor doing roundtrip it will make network line busy and also make time consuming methods. First of all select query gernate output and after that cursor goes one by one so roundtrip happen.Another disadvange of cursor are ther are too costly because they require lot of resources and temporary storage so network is quite busy.
What is different in Rules and Constraints
Rules and Constraints are similar in functionality but there is a An little diffrence between them.Rules are used for backward compatibility . One the most exclusive diffrence is that we an bind rules to a datatypes whereas constraints are bound only to columns.So we can create our own datatype with the help of Rules and get the input according to that.
What Is Database
A database is similar to a data file in that it is a storage place for data. Like a data file, a database does not present information directly to a user; the user runs an application that accesses data from the database and presents it to the user in an understandable format.Database systems are more powerful than data files in that data is more highly organized. In a well-designed database, there are no duplicate pieces of data that the user or applicati
on must update at the same time. Related pieces of data are grouped together in a single structure or record, and relationships can be defined between these structures and records.When working with data files, an application must be coded to work with the specific structure of each data file. In contrast, a database contains a catalog that applications use to determine how data is organized. Generic database applications can use the catalog to present users with data from different databases dynamically, without being tied to a specific data format. A database typically has two main parts: first, the files holding the physical database and second, the database management system (DBMS) software that applications use to access data. The DBMS is responsible for enforcing the database structure, including: � Maintaining relationships between data in the database. Ensuring that data is stored correctly, and that the rules defining data relationships are not violated. � Recovering all data to a point of known consistency in case of system failures.

what is Relational Database
Although there are different ways to organize data in a database, relational databases are one of the most effective. Relational database systems are an application of mathematical set theory to the problem of effectively organizing data. In a relational database, data is collected into tables (called relations in relational theory). A table represents some class of objects that are important to an organization. For example, a company may have a database w
ith a table for employees, another table for customers, and another for stores. Each table is built of columns and rows (called attributes and tuples in relational theory). Each column represents some attribute of the object represented by the table. For example, an Employee table would typically have columns for attributes such as first name, last name, employee ID, department, pay grade, and job title. Each row represents an instance of the object represented by the table. For example, one row in the Employee table represents the employee who has employee ID 12345. When organizing data into tables, you can usually find many different ways to define tables. Relational database theory defines a process called normalization, which ensures that the set of tables you define will organize your data effectively.

What is COMMIT and ROLLBACK statement in SQL
Commit statement helps in termination of the current transaction and do all the changes that occur in transaction persistent and this also commits all the changes to the database.COMMIT we can also use in store procedure. ROLLBACK do the same thing just terminate the currenct transaction but one another thing is that the changes made to database are ROLLBACK to the database.
Can you tell me the difference between DELETE and TRUNCATE commands
Delete command removes the rows from a table based on the condition that we provide with a WHERE clause. Truncate will actually remove all the rows from a table and there will be no data in the table after we run the truncate command.
What are the Global Temporary Tables
We can create global temporary tables but these are not using much in sql an the name of these table start with two pound signs. For example, ##interviewqsn is a global temporary table.As the name suggest these table is Global temporary tables and visible to all SQL Server connections. When we create any one of these all users can see it.
What is Cursor
Cursor is a database object used by applications to manipulate data in a set on a row-by-row basis, instead of the typical SQL commands that operate on all the rows in the set at one time. For example, you can use cursor to include a list of all user databases and make multiple operations against each database by passing each database name as a variable

Infopath

http://redcapeco.wordpress.com/2010/09/18/create-a-reusable-template-part-in-infopath-2007/
http://msdn.microsoft.com/en-us/library/bb644236(v=office.12).aspx



BCS and Infopath
http://www.sharepoint24x7.com/2011/04/article-%E2%80%93-business-connectivity-services-bcs-part-iv-%E2%80%93-creating-an-external-list/

http://www.infopathdev.com/blogs/


http://blogs.msdn.com/b/russmax/archive/2011/06/14/using-hidden-content-types-in-sharepoint-2010-part-1.aspx

http://johanolivier.blogspot.com/search/label/SilverLight%20for%20SharePoint%202007

http://blogs.msdn.com/b/infopath/

InfoPath and Web Service data connection
Create web service to return employee data:....

http://blogs.msdn.com/b/jannemattila/archive/2007/01/21/infopath-and-web-service-data-connection.aspx

Rapid Application Development Using InfoPath and BCS


infopath Tutiorial

Monday, August 29, 2011

ASP.NET Interview Questions

ASP.NET Interview Questions
Managed vs. unmanaged code
 Managed code runs through a runtime which is a software layer that the application communicates due to which many functions are automatically done. Some of these functions are garbage collecting and exception handling.
 A programmer needs to write many common functions in an unmanaged code. So functions like garbage collecting, exception handling, etc have to be handled explicitly.
Explain - consuming unmanaged DLL functions using PInvoke.
PInvoke = Platform invoke.
Calling a function located in an unmanaged DLL library from .NET framework is called consuming unmanaged DLL function.
When PInvoke calls an unmanaged function,
The DLL containing the function is located and loaded it into memory.
Then the function arguments are pushed into the stake and then the data is marshalled required.
And then the control is transferred to the unmanaged function.
PInvoke throws exceptions generated by the unmanaged function to the managed caller.
Explain how managed code slower than unmanaged code.
Managed code executes under the management of a virtual machine. It is executed by a common language runtime environment rather than directly by the operating system. Tasks such as Exception handling and GC too are handled in the managed code environment. Due to all these reasons, managed code is slower than the unmanaged code.
What are the advantages of using SQL stored procedures instead of adhoc SQL queries in an ASP.NET web application?
Better Performance : As stored procedures are precompiled objects they execute faster than SQL queries. Every time we run a SQL query, the query has to be first compiled and then executed where as a stored procedure is already compiled. Hence executing stored procedures is much faster than executing SQL queries.
Better Security : For a given stored procedure you can specify who has the rights to execute. You cannot do the same for an SQL query. Writing the SQL statements inside our code is usually not a good idea. In this way you expose your database schema (design) in the code which may be changed. Hence most of the time programmers use stored procedures instead of plain SQL statements.
Reduced Network Traffic : Stored Procedures reside on the database server. If you have to execute a Stored Procedure from your ASP.NET web application, you just specify the name of the Stored Procedure. So over the network you just send the name of the Stored Procedure. With an SQL query you have to send all the SQL statements over the network to the database server which could lead to increased network traffic.
What is the difference between a DataReader and a DataSet?
DataReader
1. DatReader works on a Connection oriented architecture.
2. DataReader is read only, forward only. It reads one record at atime. After DataReader finishes reading the current record, it moves to the next record. There is no way you can go back to the previous record. So using a DataReader you read in forward direction only.
3. Updations are not possible with DataReader.
4. As DataReader is read only, forward only it is much faster than a DataSet.
DataSet
1. DataSet works on disconnected architecture.
2. Using a DataSet you can move in both directions. DataSet is bi directional.
3. Database can be updated from a DataSet.
4. DataSet is slower than DataReader.
Give an example scenario of using a DataSet and a DataReader?
If you want to just read and display the data(No updates, deletes, or inserts) then use a DataReader.
If you want to do a batch inserts, updates and deletes then use a DataSet.
What do you mean by WCF and WPF and WWF
WPF is also known as AVALON its basically a presentation platform provided by Microsoft. Its a rich client applications which have full graphical capabilities . Its provide powerful, flexible programming model also integrates support for flexible layout, high-quality resolution-independent graphics, animation, video and 3D. Basically it is designed to provide the full capabilities of the high-performance graphics cards, it offers high-level abstractions
that offer great power to the developer for less development effort than ever before.
WCF is also knowon as Indigo . Its a set of .NET technologies for building and running connected systems comes with asp.net 3.0 and 3.5 and for asp.net 2.0 user have to install the MS add in component for WCF. . WCF comes up as a replacement for Remoting and Web service in dotnet. It can use the protocols like Http and TCP comes with default windows based security feature. The componets WCF are data contract, Service Contract and the Service programme. WCF can be extended to use protocols other than SOAP to communicate with Web services
WWF is also known as WORKFLOW .We can automate all the process there may be some points in a process will require interaction from a human, device or perhaps even another system. A workflow is the steps in a path a of process that takes into account points where interactions take place. Initally WWF engine will work in just Visual Studio 2005 for the moment but will soon be included in Biztalk and Sharepoint services.

differnce between WCF and WebServices and Remoting
Web Services
1.It Can be accessed only over HTTP
2.It works in stateless environment
3.It support only the datatypes defined in the XSD type system, limiting the number of objects that can be serialized.
4.It support only the datatypes defined in the XSD type system, limiting the number of objects that can be serialized.
Remotig
1.It Can be accessed over any protocol
2.Provide support for both stateful and stateles
s environments through Singleton and SingleCall objects
3.Using binary communication, .NET Remoting can provide support for rich type system
4.It requires the client be built using .NET, enforcing homogenous environment.
WCF
WCF is flexible because its services can be hosted in different types of applications. The following lists several common scenarios for hosting
WCF services: IIS WAS Self-hosting Managed Windows Service

Is it possible to turn off cookies for one page
By setting Cookie.Discard property false
Why it is bed to throw our own exceptions in try catch bock
If we know the point where an error has occurred, then why not write the proper code to handle that error instead of passing a new Exception object to the catch block? Throwing your own exceptions signifies some design flaws in the project.
What is impersonation in ASP.NET?
By default, ASP.NET executes in the security context of a restricted user account on the local machine.
However, at times it becomes necessary to access network resources which require additional permissions.
This can be done away with using impersonation. ASP.NET can then execute the request using the identity of the client making the request.
ASP.NET can also impersonate a specific account you specify in web.config.

Difference between authentication and authorization.
Authentication is the process of verifying the identity of a user.
Authorization is process of checking whether the user has access rights to the system.
Authorization is the process of allowing an authenticated user access to resources.
Authentication always proceeds to Authorization.
Overview of ADO.NET architecture.
Data Provider provides objects through which functionalities like opening and closing connection, retrieving and updating data can be availed.
It also provides access to data source like SQL Server, Access, and Oracle).
Some of the data provider objects are:
 Command object which is used to store procedures.
 Data Adapter which is a bridge between datastore and dataset.
 Datareader which reads data from data store in forward only mode.
 A dataset object is not in directly connected to any data store. It represents disconnected and cached data. The dataset communicates with Data adapter that fills up the dataset. Dataset can have one or more Datatable and relations.
 DataView object is used to sort and filter data in Datatable.
Define connected and disconnected data access in ADO.NET
Data reader is based on the connected architecture for data access. Does not allow data manipulation
Dataset supports disconnected data access architecture. This gives better performance results.
Define connected and disconnected data access in ADO.NET
Data reader is based on the connected architecture for data access. Does not allow data manipulation
Dataset supports disconnected data access architecture. This gives better performance results.
Windows authentication.
If windows authentication mode is selected for an ASP.NET application, then authentication also needs to be configured within IIS since it is provided by IIS.
IIS provides a choice for four different authentication methods:
Anonymous: IIS doesn’t perform any authentication. All are allowed to access the ASP.NET application.
Basic: users must provide a windows username and password to connect. This information is plain text which makes this mode insecure.
Digest: Users need to provide a password which is sent over the network. However in this case the password is hashed. It also requires that all users be using IE 5 or later versions.
Windows integrated: passwords are not sent over the network. The application uses either the Kerberos or challenge/response protocols authenticate the user. Users need to be running IE 3.01 or later.
Passport authentication
Passport authentication provides authentication using Microsoft’s passport service.
If passport authentication is configured and users login using passport then the authentication duties are off-loaded to the passport servers.
Passport uses an encrypted cookie mechanism to indicate authenticated users. The passport users are considered authenticated while the rest are redirected to the passport servers to log in, after which they are redirected back to the site.
Passport Software Development Kit can be downloaded and installed http:// msdn.microsoft.com/library/default.asp?url=/downloads/list/websrvpass.aps.
Forms authentication
Using form authentication, ones own custom logic can be used for authentication.
ASP.NET checks for the presence of a special session cookie when a user requests a page for the application. Authentication is assumed if the cookie is present else the user is redirected to a web form.
.NET Debug & Trace
Here you can learn about break mode, options to step through code in .Net, Debug Vs Trace in .Net, trace class, listeners collection of Trace and Debug objects and Trace Switches.


CRM:


Microsoft CRM Interview Questions - Part 2


Q: What is CRM Service of MSCRM?

Ans:- CRM Service is the main web service and it exposes Six methods such that you can write your code against CRM entities. To perform operation other than the six operations (six methods provided by mscrm) we will have to use the Execute method.

Q: What is Metadata service of MSCRM.

Ans:- Dictionary meaning of the word METADATA is data about data and similarly the metadata holds the information about MSCRM means the information about the entity and attribute e.g. Display name, platform name, size of the attribute, datatype of attribute etc. If we want to access any information about any entity (Dynamic or system) we will have to make use of the Metadata service. In the database we can find the metadata table and name of these table begins with keyword Metadata.

Q: What is discovery Service?

Ans:- The Discovery service is a global service that helps the caller to detemine the correct organization and URL. Microsoft CRM server may include several servers. Each server might be dedicated to multiple organization. Each of these servers will have dedicated web-service URL for faster operations. Internally the Microsoft CRM server allocation may change so the discovery service directs the request to its corresponding web-server for further processing.
In short the Discovery service responsibility is to find the 'CRM Service' and 'Metadata Service' urls.

The discovery service returns the list of organization URLs that the current-requester (current user) belongs to. During the Outlook client configuration discovery service shows he list of organization the current-user belongs to.

This web-service is used to create authentication ticket in case of Windows live authentication.

Q. Suppose I want to migrate an Microsoft CRM implementation from one environment to other environment. Let us assume that there a published workflow for account entity. Now in normal usage there will be few accounts-records for which the workflow will be waiting/Waiting for Resource/Failed/Succeded state. So what should be our strategy for the migration. What will happen to the records which are in waiting state and what will happen to the records which are in-progress?

Q. Suppose there is a plug-in registered for account entity. When a user submits a request (e.g. account creation etc.) to the web-server then what will happen in the server?

Ans:- The plug-in will get loaded into the memory and will perform the operation it is needed to do.

Q. Now what will happen if 100 users will submit the request to the web-server? The plug-in code will get loaded into the memory for 100 times?

Ans:- Answer is NO. Noticable point over here is that the Microsoft CRM is a mananged application and runs under .Net framework. So whenever the first request arrives at the web-server the plug-in code is loaded into the memory and will perform its operation and susequently the same plug-in code will serve the process for other user as well. So this way it saves the amount of time required to load the plug-in into the memory. If the plug-in code is not being used for long then the Garbage collector will identify it and will sweep the plug-in out from the memory.

Q. How to add/remove columns in an entity lookup window.

Ans:- Go to Settings >> Customization >> Select the entity >> Click 'Forms and Views in the Left Nav Pane" >> Double click the 'Entity Lookup View' >> Dialog box appears that contains the Add/Remove and Sorting options for a lookup view.



Q. How to Debug the java script that we write for some validation on entity pages.

Ans:- Following are the steps that are needed to be followed:
1. Enable the Debugging in the Internet Explorer - Goto Tools >> Internet Options (wizard will appear >> Click the 'Advanced Tab' >> Under Browsing Section uncheck the 'Disable script debutting' checkbox >> Click OK.
2. Edit the java script code of the Entity Page that you want to debug.
3. Put the statement 'debugger;' above the line where you want do the debugging. e.g. suppose my java-script show 'Hello World' message and i want to debug this then following is the way I am going to add script:
debugger;
alert('Hello World')
4. Save and Publish corresponding customization.
5. Perform the operation that would trigger the java script written by you
6. Debugger dialog box will appear and select appropriate debugger (Visual Studio new or existing instance)
And you may start debugging from the 'Debugger' statement of your javasript.


Microsoft Dynamics CRM Interview Questions

1. What is a Plug-in?
2. What is a Workflow?
3. What are the differences between Plug-in and a Workflow?
4. What are the differences between Asynchronous Plug-in and a Workflow?
5. When will you use a workflow and when will you use a Plug-in? Give some Real-life scenario.
6. What is an Email-Router?
7. What are the steps to configure an Email router?
8. How the Plug-in and Workflow will behave in case of Off-line client?
9. What is Metadata?
10. What is CRM Discovery Service?
11. What is Sales and Marketing life cycle in MSCRM?
12. What is Queue entity in MSCRM?
13. What is 1:1, 1:N and N:N relationship in Microsoft Dynamics CRM?
14. How a Plug-in is different from a Call-out?
15. What is 'Append' and 'Append To' privilege in MSCRM? Give one example of it?

Ans:- 'Append' and 'Append To' priviledges works together. 'Append To' priviledge will allow other entities to get attached with the entity. 'Append' priviledge will allow the entity to attach the records to the entity with 'Append To' privildege.

Let us understand this with simple example:
Let us say that you want to attach a note to a case then note entity should have 'Append' access right and case entity should have 'Append To' access right.

Let us take one more example to understand this. Suppose you have two custom entities called 'TestCustomEntity1' and 'TestCustomEntity2'. You want to attach the 'TestCustomeEntity2' records to 'TestCustomEntity1'records. For this you need to have 'Append' access right on 'TestCustomEntity1' entity and 'Append To' access right on 'TestCustomEntity2'.
Now guess will I be able to attach the records? Answer is "NO" because we need to create a 1:N relationship between 'TestCustomEntity1' and 'TestCustomEntity2'.
Now the user who has above mentioned access right in his security role will only be able to add 'TestCustomEntity2' records to 'TestCustomEntity1'.



16. How to create a Custom Entity record using SDK?

Ans:- Using Dynamic Entity.

17. How to join two table using Query Expression?

Ans:- Using Linked entity. You should always try to minimize the number of SWS calls that we make in the database. Often during code review it is explored that the number of Microsoft CRM web-service could have been reduced by making use of the Linked-entity concept. So we should always look for the opportunity to minimize the effort.

18. Can we modify the name of Root Business Unit?

Ans:- No; We will have to re-install MSCRM.

19. Suppose if I have 20 user license and I have created 20users. What will happen if I create 21st User?

Ans:- The 21st User will get created in MSCRM but that user will be in disabled state.

20. What are the maximum number of tabs allowed on a Microsoft Dynamics CRM 4.0 form?

Ans:- 8

21. How to enable/disable the form assistant? How to make sure the form assitant is expanded/cllapsed on a form?

Ans:- Navigate to Customization >> Open the Entity >> Open Forms and Views >> Open Form >> Select Form Properties >> Open Display Tab >> Check/Uncheck the "Enable the Form Assistant" and "Expanded by Default".

The interviewer will always try to figure-out whether one is comfortable with the basic concepts of Microsoft CRM (MS CRM) or not and after that; questions will be asked from your previous experience (if you have any experience in CRM). Those questions will be something like this:

1. What was you role in the MSCRM implementation project that you have worked on?

Ans:- You should be honest while giving answer to this question and should give a brief overview of the project and your role. This is very important question because the answer of this question will tigger so many questions. You should highlight the key skills you have; this way you will divert the attention of the interviewer to your key skills and try not to expose the area in which you are less confident.

2. What was the most challenging task you have faced till now?

Ans:- Here you should give answer that exihibit your positive attiude . e.g. for a techincal consultant it may be something like ... "I was new to the suppport and during this experience i faced challenging issue related to plug-in that impoved my debugging skills. Email-to-case plug-in was really diffcult as we had to take care of so many conditions. I have learnt one thing during my previos assignment and that is 'Never give-up'".
What are the differences between Plug-in and a Workflow?
Workflows:
1.Can be created via the CRM user interface, without code
2.Can be run manually
3.Always run asynchronously
Plugins:
1.Necessarily written as .Net code
2.Registered in CRM via tools in the SDK
3.Cannot be run manually
4.Support more events than workflow
5.Can run before changes are committed to database, and hence cancel changes
6.Can run synchronously or asynchronously
A common question I get is ‘what is the difference between workflow and plugins, and when should I use one or the other ?’. This article is intended to be a comprehensive answer to these 2 questions.
First of all, I want to clarify the distinction between what I consider 3 distinct categories of workflow – the terminology is my own:
• Simple workflow. This is one or more workflow rules created within the MSCRM interface, and which do not include custom workflow activities.
• Workflow with custom workflow activities. I’ll explain more about custom workflow activities later in this article; for now the key point is that a custom workflow activity is .Net code that is written to perform functions not possible in simple workflow, and this code can be called from a workflow rule
• Workflows created with the Workflow Designer in Windows Workflow Foundation. It is possible to build workflows outside of the CRM user interface, but I’m not going to include them in this article.
Simple workflows

The main characteristics of simple workflows are:
• Creating a simple workflow involves no code
• Workflows run only on the CRM server – workflow processing is not available within a client that is offline
• Workflows run asynchronously – any data changes made within a workflow rule will not show up immediately within the CRM user interface
• Workflows can be run manually or automatically. The automatic running of workflows is based on several data modification events
• Workflow rules are entity specific
• The state and stage of a workflow instance can be viewed within the CRM user interface by any CRM user with appropriate permissions


Some limitations of workflows are:-
• Workflow rules cannot be created for all entities
• Although workflow rules can be triggered by the most common data modification events, there are some events that don’t trigger workflow rules
• Simple workflows offering limited capability to perform calculations
Characteristics and limitations marked with an asterix (*) do not apply if using custom workflow activities; the others do still apply.
Custom workflow activities

Custom workflow activities allow you to extend the capabilities of workflow rules. Three common uses are to perform calculations on CRM data, to access CRM functionality that is not available in the out-of-the-box workflow activities, and to access external data.
Custom workflow activities are written as .Net assemblies which have to be registered on the CRM server. These assemblies can include information about parameters that can be passed into or out of the activity.
Plugins

A plugin is .Net code that is registered on the CRM server. A plugin assembly can be registered for one or more steps – these steps correspond to the combination of the message (event), entity and stage. An example of a step would be the Create message for the account entity on the pre-event stage. Registration of the assembly and steps is part of the plugin deployment process, and there is no direct user interaction with plugins
The main characteristics of plugins are:
• They have to be written as .Net code
• Although they typically run on the CRM server, they can be deployed and configured to run on a CRM client that is offline
• They can run either synchronously or asynchronously. If they run synchronously, any data changes made within the plugin will show up immediately within the CRM user interface
• Synchronous plugins can run on either the pre-event or post-event stage. The pre-event stage happens before data is written to the CRM database, and a plugin registered on a pre-event step can cancel the data writing and provide an error message to the user.
• More entities can have plugins registered for them than can have workflow rules
• Plugins can run on more events than can workflow rules. An example is that plugins can run on data retrieval, not just modification events
The main limitations of plugins are:
• Plugins cannot be run manually; they only run on the steps for which they are registered
• There is no user interaction with plugins, other than error messages that might be throw by a synchronous plugin
Sample Scenarios

So, having covered the main characteristics and limitations of simple workflows, custom workflow activities and plugins, when should you choose one or another ? Here are some common scenarios:





What you want to achieve can be done with a simple workflow, and it is acceptable or desirable for this to happen asynchronously and on the server only

Ans:- In this case I’d go with simple workflows; there’s no point writing code if you don’t have to.

What you want to achieve has to run synchronously

Ans:- If so, workflow won’t do, so it would have to be a plugin. An alternative could be to use client script, but I don’t intend to complicate this article by including this in any more detail

You need to be able to cancel the data operation

Ans:- A pre-event plugin is the only option covered here, though again client script should be considered

You want to give users the discretion to run the operation manually

Ans:- Here you’ll need a workflow. Whether or not you need a custom workflow activity depends on the complexity of the operations. Again, there may be an option outside of the scope of this article – to write an ASP .Net application that is called from an ISV Config button

You need to write custom code, but you want users to decide whether this code should run, and under what circumstances

Ans:- In this case I’d go with a custom workflow activity, as you could make this available for users to add to their own workflows
What is Microsoft Dynamics CRM 4.0 E-Mail Router?

Ans:- Microsoft Dynamics CRM 4.0 E-Mail Router is a software component that creates an interface between a Microsoft Dynamics CRM 4.0 deployment and the Organization`s messaging system. The E-mail Router routes qualified e-mail messages to the Microsoft Dynamics CRM system as e-mail activities and fully integrates with different messaging system such as Microsoft Exchange Server, POP3 and SMTP. This new version of E-Mail Router includes the functionality for sending e-mail through any desired SMTP provider as well receiving e-mail from Microsoft Exchange Server or a POP3 Server. Additionally, the Forward Mailbox feature remains available.

For more information about how to implement Microsoft Dynamics CRM 4.0 E-mail Router:
Microsoft Dynamics CRM: How to configure the On-premise and Online E-mail Router in different deployment scenarios
http://www.microsoft.com/downloads/details.aspx?FamilyID=8ea05b4e-825a-4db1-ad59-d894aa5ef33e


Should I have Microsoft Exchange Server installed in my Active Directory domain?

Ans:- You do not need Microsoft Exchange Server installed to send and receive e-mail messages from Microsoft Dynamics CRM 4.0. You can use an external or in-house SMTP and POP3 services to send and receive e-mail messages.


Where can I install Microsoft Dynamics CRM 4.0 E-mail Router?

Ans:- You can install Microsoft Dynamics CRM 4.0 E-mail Router on a Windows Server computer that is not running Microsoft Exchange Server and it has to meet system requirements. However, it is not mandatory to install Microsoft Dynamics CRM 4.0 E-mail Router for users to send or to receive e-mail. You can use Microsoft Office Outlook for this purpose.

For more information about Microsoft Dynamics CRM 4.0 E-mail Router system requirements:
Microsoft Dynamics CRM 4.0 Implementation Guide
http://www.microsoft.com/downloads/details.aspx?FamilyID=1ceb5e01-de9f-48c0-8ce2-51633ebf4714

What Microsoft Exchange Server versions are supported with E-mail Router?

Ans:- Microsoft Dynamics CRM 4.0 E-mail Router supports Microsoft Exchange Server 2003, Microsoft Exchange Server 2007 and Microsoft Exchange Server 2010. However, you must install the latest Update Rollup version for Microsoft Dynamics Server and E-mail Router in order to support Microsoft Exchange Server 2010 with Update Rollup 2.

For more information about the latest Microsoft Dynamics CRM Update Rollup:
http://support.microsoft.com/kb/949256

For more information about Update Rollup 2 for Exchange Server 2010:
http://support.microsoft.com/kb/979611


How can I improve E-mail Router within large deployments?

Ans:- You can improve E-mail Router performance by implementing the following recommendations:

• Apply the latest Update Rollup for both Microsoft CRM Server and E-mail Router.
• Avoid TCP/IP port exhaustion:
For Windows Server 2003: http://msdn.microsoft.com/en-us/library/aa560610(BTS.20).aspx
For Windows Server 2008: http://www.microsoft.com/downloads/details.aspx?familyid=12AC9780-17B5-480C-AEF7-5C0BDE9060B0
• Apply recommendations described in following KB article:
Microsoft Dynamics CRM 4.0 slows to unacceptable levels when you process e-mail messages by using the Microsoft Dynamics CRM E-mail Router
http://support.microsoft.com/kb/959248


How can I achieve high availability for Microsoft Dynamics CRM E-mail Router service?

Ans:- You can achieve high availability for Microsoft Dynamics CRM E-mail Router service by deploying on multiple computers using Windows Server clustering technology.

For more information about clustering E-mail Router service:
Install Microsoft Dynamics CRM Online E-mail Router on multiple computers
http://rc.crm.dynamics.com/rc/regcont/en_us/live/articles/emailrouter_failovercluster.aspx


How can I measure the performance of Exchange E-Mail Router?

Ans:- You can use MSCRMEmail Performance Objects in Performance Monitor to monitor servers on which Microsoft Dynamics CRM E-Mail Router is installed. MSCRMEmail Performance Objects measures the performance of the following objects:

• Incoming e-mail messages delivered
• Incoming e-mail messages discarded
• Incoming e-mail messages potentially corrupted
• Incoming e-mail messages processed
• Incoming e-mail messages processed per second
• Incoming e-mail messages undelivered
• Incoming mailbox access attempt failures
• Incoming mailbox access attempts
• Outgoing e-mail messages delivered
• Outgoing e-mail messages processed
• Outgoing e-mail messages processed per second
• Outgoing e-mail messages undelivered
• Service configuration refreshes
• Service configuration scheduling cycles
• Service provider load failures
• Service providers aborted
• Service providers executed
• Service providers failed
• Service providers refreshed
• Service providers removed
• Service providers started


How can E-mail Router be part of my backup plan?

Ans:- All settings for Microsoft Dynamics CRM 4.0 E-mail Router are stored in configurations files and in the Organization database. You should regularly take backups of the Organization database and the following files:

• Microsoft.Crm.Tools.EmailAgent.Configuration.bin
• Microsoft.Crm.Tools.EmailAgent.SystemState.xml
• Microsoft.Crm.Tools.EmailAgent.xml
• EncryptionKey.xml (if it exists)


Does Microsoft Dynamics CRM 4.0 E-mail Router support Microsoft Exchange Server with self-signed certificate?

Ans:- The Microsoft Dynamics CRM 4.0 E-mail Router does not support self-signed certificates. You must implement a signed certificate on the server that runs Microsoft Exchange Server.

For more information about the Microsoft Dynamics CRM 4.0 E-mail Router and SSL Certificates:
http://support.microsoft.com/kb/954584


Can I disable Tracking Token or Smart Matching?

Ans:- You can disable Tracking Token through the System Configuration and Email Tab in Microsoft Dynamics CRM 4.0. The Smart Matching can be disabled by following the instructions from the KB 958084.
1. to database, and hence cancel changes
2. Can run synchronously or asynchronouslyAS





ASP.NET INTERVIEW QUESTIONS
What do I need to create and run an ASP.NET application?
• Windows 2000, Windows Server 2003 or Windows XP.
• ASP.NET, which can be either the redistributable (included in the .NET SDK) or Visual Studio .NET.
Where can I download the .NET SDK?
.NET SDK can be obtained here.
(You have to install the Microsoft .NET Framework Version 1.1 Redistributable Package before installing the .NET SDK.)
Are there any free IDEs for the .NET SDK?
o Microsoft provides Visual Studio 2005 Express Edition Beta for free. Of particular interest to the ASP.NET developers would be the Visual Web Developer 2005 Express Edition Beta 2 available as a free download.
o The ASP.NET Web Matrix Project (supported by Microsoft) is a free IDE for developing ASP.NET applications and is available here.
o There is also a free open-source UNIX version of the Microsoft .NET development platform called Mono available for download here.
o Another increasingly popular Open Source Development Environment for .NET is the #develop (short for SharpDevelop) available for download here.
When was ASP.NET released?
ASP.NET is a part of the .NET framework which was released as a software platform in 2002.
Is a new version coming up?
ASP.NET 2.0, Visual Studio 2005 (Whidbey), Visual Web Developer 2005 Express Edition are the next releases of Microsoft's Web platform and tools. They have already been released as Beta versions. They are scheduled to be released in the week of November 7, 2005.
Explain Namespace.
Namespaces are logical groupings of names used within a program. There may be multiple namespaces in a single application code, grouped based on the identifiers’ use. The name of any given identifier must appear only once in its namespace.

List the types of Authentication supported by ASP.NET.
o Windows (default)
o Forms
o Passport
o None (Security disabled)
What is CLR?
Common Language Runtime (CLR) is a run-time environment that manages the execution of .NET code and provides services like memory management, debugging, security, etc. The CLR is also known as Virtual Execution System (VES).
What is CLI?
The CLI is a set of specifications for a runtime environment, including a common type system, base class library, and a machine-independent intermediate code known as the Common Intermediate Language (CIL). (Source: Wikipedia.)
List the various stages of Page-Load lifecycle.
o Init()
o Load()
o PreRender()
o Unload()
Explain Assembly and Manifest.
An assembly is a collection of one or more files and one of them (DLL or EXE) contains a special metadata called Assembly Manifest. The manifest is stored as binary data and contains details like versioning requirements for the assembly, the author, security permissions, and list of files forming the assembly. An assembly is created whenever a DLL is built. The manifest can be viewed programmatically by making use of classes from the System.Reflection namespace. The tool Intermediate Language Disassembler (ILDASM) can be used for this purpose. It can be launched from the command prompt or via Start> Run.
What is Shadow Copy?
In order to replace a COM component on a live dedicated server, it was necessary to stop the entire website, copy the new files and then restart the website. This is not feasible for the web servers that need to be always running. .NET components are different. They can be overwritten at any time using a mechanism called Shadow Copy. It prevents the Portable Executable (PE) files like DLLs and EXEs from being locked. Whenever new versions of the PEs are released, they are automatically detected by the CLR and the changed components will be automatically loaded. They will be used to process all new requests not currently executing, while the older version still runs the currently executing requests. By bleeding out the older version, the update is completed.
What is DLL Hell?
DLL hell is the problem that occurs when an installation of a newer application might break or hinder other applications as newer DLLs are copied into the system and the older applications do not support or are not compatible with them. .NET overcomes this problem by supporting multiple versions of an assembly at any given time. This is also called side-by-side component versioning.
Explain Web Services.
Web services are programmable business logic components that provide access to functionality through the Internet. Standard protocols like HTTP can be used to access them. Web services are based on the Simple Object Access Protocol (SOAP), which is an application of XML. Web services are given the .asmx extension.
Explain Windows Forms.
Windows Forms is employed for developing Windows GUI applications. It is a class library that gives developers access to Windows Common Controls with rich functionality. It is a common GUI library for all the languages supported by the .NET Framework.
What is Postback?
When an action occurs (like button click), the page containing all the controls within the tag performs an HTTP POST, while having itself as the target URL. This is called Postback.
Explain the differences between server-side and client-side code?
Server side scripting means that all the script will be executed by the server and interpreted as needed. Client side scripting means that the script will be executed immediately in the browser such as form field validation, clock, email validation, etc. Client side scripting is usually done in VBScript or JavaScript. Since the code is included in the HTML page, anyone can see the code by viewing the page source. It also poses as a possible security hazard for the client computer.
Enumerate the types of Directives.
o @ Page directive
o @ Import directive
o @ Implements directive
o @ Register directive
o @ Assembly directive
o @ OutputCache directive
o @ Reference directive

What is Code-Behind?
Ans:- Code-Behind is a concept where the contents of a page are in one file and the server-side code is in another. This allows different people to work on the same page at the same time and also allows either part of the page to be easily redesigned, with no changes required in the other. An Inherits attribute is added to the @ Page directive to specify the location of the Code-Behind file to the ASP.NET page.
Describe the difference between inline and code behind.
Ans:- Inline code is written along side the HTML in a page. There is no separate distinction between design code and logic code. Code-behind is code written in a separate file and referenced by the .aspx page.
List the ASP.NET validation controls?
o RequiredFieldValidator
o RangeValidator
o CompareValidator
o RegularExpressionValidator
o CustomValidator
o ValidationSummary
What is Data Binding?
Data binding is a way used to connect values from a collection of data (e.g. DataSet) to the controls on a web form. The values from the dataset are automatically displayed in the controls without having to write separate code to display them.
Describe Paging in ASP.NET.
The DataGrid control in ASP.NET enables easy paging of the data. The AllowPaging property of the DataGrid can be set to True to perform paging. ASP.NET automatically performs paging and provides the hyperlinks to the other pages in different styles, based on the property that has been set for PagerStyle.Mode.
Should user input data validation occur server-side or client-side? Why?
All user input data validation should occur on the server and minimally on the client-side, though it is a good way to reduce server load and network traffic because we can ensure that only data of the appropriate type is submitted from the form. It is totally insecure. The user can view the code used for validation and create a workaround for it. Secondly, the URL of the page that handles the data is freely visible in the original form page. This will allow unscrupulous users to send data from their own forms to your application. Client-side validation can sometimes be performed where deemed appropriate and feasible to provide a richer, more responsive experience for the user.
What is the difference between Server.Transfer and Response.Redirect?
o Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser.
o Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well.
What is a Session?

Ans:- A Session is a unique instance of the browser. A single user can have multiple instances of the browser running on his or her machine. If each instance visits your Web application, each instance has a unique session.A session starts when a user accesses a page on a Web site for the first time, at which time they are assigned a unique session ID. The server stores the user's session ID in the Session.SessionID property.

What is the default session timeout period?
Ans:- 20 minutes.

Where do you generally specify the Session Timeout?
Ans:- You specify the Session Timeout setting in the web.config file.

Can you specify Session Timeout in a code behind file?
Ans:- Yes, can specify the Session.Timeout property as shown below in a code behind file.
Session.Timeout = 10;

How do you end a user session?
Ans:- You can call the Session.Abandon() method to end a user session. If a user then tries to access a page the server will assign them a new session ID and it will clear all the previous session variables. You'll typically use Session.Abandon() on log-out pages.

What type of data can you store in Application State and Session State variables?
Ans:- Application State and Session State variables are used to store data that you want to keep for the lifetime of an application or for the lifetime of a session. You can store any type of data in the Application or Session state, including objects.

Are Application State or Session State variables type safe?
Ans:- No, Application and Session state variables are created on the fly, without variable name or type checking.

Do maintaining Session state affects performance?
Ans:- Yes

Can you turn of Session state?
Ans:- Yes, Session state can be turned off at the application and page levels.

Are Application state variables available throughout the current process?
Ans:- Yes, Application state variables are available throughout the current process, but not across processes. If an application is scaled to run on multiple servers or on multiple processors within a server, each process has its own Application state.

How do you disable Session state for a Web form?
Ans:- To turn Session state off for a Web form set EnableSessionState property of the Page to False.

How do you turn Session state off for an entire web application?
Ans:- In the Web.config file, set the sessionstate tag to False.

What are Application State variables?
Ans:- Application State variables are global variables that are available from anywhere in the application. All Sessions can access Application State variables.

How to add and remove data to Application State Variables?
Ans:- //Code to add data to Application State
Application.Add("AppName", "Sample");

//Code to remove data from Application State
Application.Remove("AppName");

How do you remove all Application State Variables data?
Ans:- //Code to remove all Application State Variables data
Application.RemoveAll();
What is the difference between Role Based and Object Based Security Model in MSCRM?
Ans:- Code based security is entirely coded in the application itself. Role based security uses one of the authentication/authorization mechanisms of the application server.
The fundamental concept in role-based security is that of privilege, defined at design time, on a system-wide basis. Each user has a set of privileges (there are well over a hundred privileges) that are enabled for that user. However, Policies and Roles grant privileges and simplify the process.
The other form of security applies to individual instances of objects. There is a fundamental difference between an access right and a privilege: an access right is a right granted to a user on an object), but a privilege is a right granted to a user on a class of objects. Access rights apply only after privileges have taken effect. In other words, if a user does not have the privilege to read accounts, the user will not be able to read any account, whether or not it has been shared.
Difference between Find and Advanced Find? Which one is faster and Why?
Ans:- Find perform a search on an attribute for which it is defined. Advanced Find perform search on the conditions and the attributes for which user customizes or runs it. Normal Find in faster as it looks for one attributes and matches with that and returns the result whereas Advanced Find searches for all the attributes and conditions while parsing through the records.
Find is applicable on only active records and it finds only on 2 or 3 column which we have defined in the find view and even it returns any those column which is there in the view but advanced find is applicable to all the records and it finds all the columns and even it returns all the column and filter criteria can be on any column and most important - find filters on just one condition but adv find filters on multiple condition at one time.. Find is faster than Advanced Find.


Difference between CRM Discovery Service and CRM Metadataservice?
Ans:- CRM service - when we need ORG related information like ORG name, Properties, CRM service path for this ORG -- then we use CRM discovery service..this is only to get the ORG related information
Meta data service - we use this when we need to interact with the CRM records – create, update or delete anything-- it is very specific to the CRM records. When we need to interact with the CRM entity and attribute -- like create an entity (not record) or attribute -- add a value to pick list-- retrieve the pick list value retrieve the entity properties-- attribute property and all we need Meta data service.
Difference between Plug-in and Workflows?
Ans:- RequirementPlug-inWorkflowNeeds a synchronous action to happen before or after an event occursXThe same piece of logic will be executed for different events and possibly on different entities XxThe logic needs to be executed while offlineXNeeds elevation of privileges (impersonation)XNeeds to execute on events other than assign, create, update, set stateXThe process/logic may take a long time to complete or will be a persistent process (multiple long running steps)xNeeds an asynchronous actionXxEnd users will need to modify the process logicxChild sub processes will be triggered x
Whenever you install MSCRM what all databases get created?
Ans:- MSCRM_Config and MSCRM_orgname
Whenever you install MSCRM what all user groups get created in Active Directory?
Ans:- UserGroupAll Microsoft CRM users . This group is updated automatically as users are added and removed from Microsoft CRM.
ReportingGroupA group that contains all users within Microsoft CRM. This group is updated as users are added to Microsoft CRM. Users in this group have read-only access to the filtered views in the Microsoft CRM database.
PrivUserGroupPrivileged Microsoft CRM user group for special administrative functions.
SQLAccessGroupA group that contains Microsoft CRM ASP.NET account and other service accounts. Members in this group have full access to the Microsoft CRM database and this group is used by the Microsoft CRM platform layer. End users should never be added to this group
o Difference between MSCRM3.0 and MSCRM4.0?
o Multiple organizations can now be hosted and WSDL APIs are now unique per organization in MSCRM4.0.
o The metadata API service has been extended to retrieve language information in MSCRM4.0.
o Plug-ins (callouts) and workflow now use the same event framework, allowing for even more extensibility.
o The SDK has been expanded to include offline access.
o Now we can programmatically create, read, update and delete the metadata such as entities, attributes and relationship.
o There are three services instead of two which we used to have in previous version
o Many to Many Relationship was not available in MSCRM3.0
o Multicurrency feature was not available in MSCRM3.0
What is 'Append' and 'Append To' privilege in MSCRM? Give one example of it ?
Ans:- 'Append' and 'Append To' priviledges works together. 'Append To' priviledge will allow other entities to get attached with the entity. 'Append' priviledge will allow the entity to attach the records to the entity with 'Append To' privildege.Let us understand this with simple example:Let us say that you want to attach a note to a case then note entity should have 'Append' access right and case entity should have 'Append To' access right.Let us take one more example to understand this. Suppose you have two custom entities called 'TestCustomEntity1' and 'TestCustomEntity2'. You want to attach the 'TestCustomeEntity2' records to 'TestCustomEntity1'records. For this you need to have 'Append' access right on 'TestCustomEntity1' entity and 'Append To' access right on 'TestCustomEntity2'.Now guess will I be able to attach the records? Answer is " NO" because we need to create a 1:N relationship between 'TestCustomEntity1' and 'TestCustomEntity2'. Now the user who has above mentioned access right in his security role will only be able to add 'TestCustomEntity2' records to 'TestCustomEntity1'.

How to create a Custom Entity record using SDK ?
Ans:-Using Dynamic Entity.

How to join two table using Query Expression ?
Ans:- Using Linked entity. You should always try to minimize the number of SWS calls that we make in the database. Often during code review it is explored that the number of Microsoft CRM web-service could have been reduced by making use of the Linked-entity concept. So we should always look for the opportunity to minimize the effort.

Can we modify the name of Root Business Unit ?
Ans:- No; we will have to re-install MSCRM.

Suppose if I have 20 user license and I have created 20users. What will happen if I create 21st User ?
Ans:- The 21st User will get created in MSCRM but that user will be in disabled state.

What is the maximum number of tabs allowed on a Microsoft Dynamics CRM 4.0 forms? 8
Ans:-How to enable/disable the form assistant? How to make sure the form assistant is expanded/collapsed on a form?Navigate to Customization >> Open the Entity >> Open Forms and Views >> Open Form >> Select Form Properties >> Open Display Tab >> Check/Uncheck the " Enable the Form Assistant" and " Expanded by Default" .The interviewer will always try to figure-out whether one is comfortable with the basic concepts of Microsoft CRM (MS CRM) or not and after that; questions will be asked from your previous experience (if you have any experience in CRM).
Those questions will be something like this:

What was your role in the MSCRM implementation project that you have worked on ?
Ans:- You should be honest while giving answer to this question and should give a brief overview of the project and your role. This is very important question because the answers of this question will trigger so many questions. You should highlight the key skills you have; this way you will divert the attention of the interviewer to your key skills and try not to expose the area in which you are less confident.

What was the most challenging task you have faced till now ?
Ans:- Here you should give answer that exhibits your positive attitude. E.g. for a technical consultant it may be something like ... " I was new to the support and during this experience i faced challenging issue related to plug-in that improved my debugging skills. Email-to-case plug-in was really difficult as we had to take care of so many conditions. I have learnt one thing during my previous assignment and that is 'Never give-up'" .

How is CRM changing and what does the business owner need to be aware of ?
Ans:- At the heart of CRM is the benefit of having the customer record at the center of the data universe rather than multiple galaxies of transactions held in separate, transaction-specific apps. So the innovation lies in new and improved visibility for putting information to use in intelligent decision making. Companies that used to serve 100 are serving 10,000, and with this kind of scaling, better top-level tools and custom dashboards are where I see CRM continuing to morph and advance.

19. Who are the newcomers to the CRM landscape?

Ans:- It is such a hot area right now, there are literally hundreds. But two I have been following are Zoho and HighRise. Both are niche vendors that have garnered great contact lists with their other products and created relatively simple implementations for their clients and others. They both illustrate the fact that CRM is no longer esoteric — it is going mainstream, which is a great thing for business, particularly customer service and data security.


20. How much should I plan to spend on a good solution?

Ans:- That’s always a tough question, given that applications vary widely in price based on whether it’s a hosted or installed delivery model, user-based or organization-wide subscription model, or a per-gigabyte or other data model. I would use the cost-per-sale and cost-per-lead values to help determine what a system is worth to a business. For most customers, services are going to be anywhere from $20 to $350 per month per user.

What exactly should I be expecting CRM to do for me?
Ans:- This is an important question, as there are many misconceptions about software and CRM in particular. Besides some fundamentals, like data security and access and ease of use, CRM will primarily help you do what you do anyway, but move it to the next level. If your main focus is customer service, CRM will help you monitor, deliver, and measure your effectiveness. If your goal is a flat organization where the right hand knows immediately what the left hand is doing, CRM will help you be informed about the customer’s world and not just what relates to your department or team.

What are your expectations for CRM in the next five years?

Ans:- First, I expect CRM to become much more commonplace. Players like Zoho and 37signals (Highrise) are knocking down barriers to entry. I also expect to see some consolidation. I think the bigger players, like Salesforce, Microsoft, and SAP, will buy up some of their smaller rivals to build into their suites and migrate their user bases. As long as the acquiring provider keeps the connections intact during the migration and meets a similar price point, it will be a win-win. I also think we’ll be seeing more mobile-friendly applications, like Salesforce’s Visualforce and NetSuite’s iPhone, to maximize data access and timeliness.




What are the most common mistakes you see companies make with CRM?

Ans:- Many organizations use Outlook BCM or Excel for managing their contacts, which offer no planning or setup process — just create a column or type in a field and get started. This causes problems when information is related and the flexible aspects of the previous solution are overlooked. There are real benefits that won’t happen without understanding the new vernacular; the specific way the new solution describes the data. For example, an “account” in Salesforce may not be the same as an “account” in Highrise. In fact, it might have another name altogether, such as “company.” Understanding how the particular vendor uses “leads” or “opportunities” will help to avoid a great deal of frustration.

Do you have a few key best practices someone considering CRM can use?

Ans:- Yes, I have three that anyone can use. First, consider your future needs. Look down the road and ask “How many contacts will I have in five years?” “How many salespeople will I have?” “How many of my people will need real-time access to this information at home or on their phones and PDAs?” “How much would it cost me to replace these contacts?”
Second, take the opportunity to clean up your data now. Moving to a CRM solution is an opportunity to start with a clean version of accurate data. De-duplicate and otherwise scrub the data to minimize the possibility of needing to import twice. For example, the flexibility of Excel and Outlook BCM allow placing incorrectly formatted information in their fields. This data will not import well without some good planning.
Third, be sure to communicate throughout the process and get early buy-in. The biggest focus of Saleforce.com with its customers is adoption. Members of your team are influencers in their departments. Leverage their expertise and influence by building a team to help you make decisions about the solution. Even if you disagree, listening, acknowledging, and respecting will build loyalty and acceptance within the process.

What advantages might CRM have for specific verticals?

Ans:- The answer to this question is not if but how much. Since CRM helps you do what you do better, if you are in a professional services company with long sales cycles, project terms, and frequent interactions and touch points, CRM will be exponentially more valuable to you. So service businesses, like lawyers, consultants, and accountants, are ripe for CRM but often have a technological aversion and a strong status quo to maintain.
Does CRM fall more to sales or marketing in most organizations?
In my experience, marketing is somewhat of a new concept in CRM. Sales is definitely involved, but most often it is operations leading the charge.

What are my best resources for finding out more about CRM?
Ans:- One resource I would recommend any company creates for it is a one- to two-page document that answers the best practice questions above and includes input from the team. Send it to five vendors your team has selected and go over the proposals to see which companies address you as a unique business — not just with a customizable offering but as a discrete business. Here are a few good sites I would recommend to anyone considering a solution

Blog Archive