Friday, December 28, 2007

Creating service with Windows Communication Foundation(WCF) - video

Recently i have started delving into WCF as my project demands and so you may find some posts related to WCF as i learn a little and i plan to share with you. TO begin with this video was very helpful to begin with for me to learn the basics of WCF.

http://weblogs.asp.net/dwahlin/archive/2007/02/03/video-creating-a-service-with-windows-communication-service-wcf.aspx

Also, visit Dan Wahlin's blog to see more illustrations, samples and video tutorials here - http://weblogs.asp.net/dwahlin/archive/tags/WCF/default.aspx

Happy learning WCF!
- DJ

CRM 4.0 SDK

With the release of CRM 4.0 offically, microsoft has planned to release the SDK for the same soon in couple of weeks. Check the first week of new year Jan 2008 here - http://msdn2.microsoft.com/en-us/dynamics/crm/bb456482.aspx for CRM 4.0 SDK download.
Happy learning and Happy New Year! Cheers - DJ

Monday, December 17, 2007

CRM 4.0 (Titan) Overview

Senior Program Manager Phil Richardson provides a nice overview of CRM 4.0 on Channel 9 Forums.

View here - http://channel9.msdn.com/showpost.aspx?postid=356796
Happy learning - Dipesh

CRM 4.0 Data Import

New CRM 4.0 Data Import -

Microsoft offers multiple options to import data into your CRM implementation. It used to have in CRM 3.0 as well but with the Release of Titan there are multiple options to explore as listed:

Bulk Import Wizard - The Bulk Import Wizard has been improved in Microsoft Dynamics CRM 4.0. The list of entities to import has been extended with almost all system entities as well as custom entities. Also, the mappings created between the source data and the CRM system can now be saved and reused in subsequent import activities. Another new feature is the ability to see the list of imported records after the import has succeeded. Based on this list actions can be executed like Quick Campaigns and even deleting the records if necessary. The last major improvement is the ability to enrich data which is already in the system.

Data Migration Framework (3.0)/ Manager (4.0) - The second tool which Microsoft offers is the Data Migration Framework. This tool can be used to import data if any of the following scenarios do apply:
A> Migrate data from multiple sources
B> There are records which are related to others within the same or another entity
C> Notes and / or attachments need to be migrated
D> Data needs to be cleansed before importing into the CRM system


There are several third party tools that can do the job as well if this out of box functionality provided by MS does not fit your bill.

CRM Extensions / c360: ImportManager -
http://www.c360.com/ImportManager.aspx
Scribe TOOL (my favourite, you should look into this if you need both ways data conversion - into CRM and from CRM to external interfaces!) -
http://www.scribesoftware.com/microsoft-dynamics-crm.asp

For additional information visit Ronald's blog - he is the man :) Cheers - Dipesh

Understanding what is best for you ..differences between VPC and Vmware

What you need - VPC or VmWare ?

No matter what your needs, it is very likely that either VMware or Virtual PC/Server can do the job. The key to choosing the right product is understanding your needs. What is it that you want to do with virtualization? Do you want to have a test network on your desktop PC? Do you want to do software development? How many servers will you run concurrently? What operating systems will be run in the virtual systems? The answers to these questions will help you choose the right virtualization product!

Choosing the right product -
Once you take a look at your needs, you will be able to better choose the product you need. For example, if you just want to run a test on Windows XP workstation or 2003 server on your local desktop, then you should choose a desktop virtualization product. Examples of these are - VMware Workstation(300$ odd) and MS Virtual PC(free). Both of those applications are designed to be run on a local desktop.

On the other hand, if you need to run more than 1 concurrent servers that required at least 1GB of RAM each, you are no longer talking about a desktop product. You require an enterprise virtualization server product! Not only because of the amount of RAM required but because we said that we would run “multiple servers”. You don’t want to run them on desktop virtualization products.

For further information or understanding their pros and cons refer - http://www.petri.co.il/virtual_vmware_virtualpc_compared.htm
To download Vmware visit - http://www.vmware.com/
To download microsoft VPC 2007 visit - http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6

Thanks - Dipesh

Monday, November 05, 2007

Browse CRM entities through CRM browser...

This was one is simple... did you know that you can find out what CRM entities exists on CRM box through IE!
It should be something like - http:///sdk/lists.aspx
…/SDK/lists.aspx
(where … is the root address to your crm web app)


Cheers - Dipesh

Microsoft Commits to November Release Date for Visual Studio 2008 and the .NET Framework 3.5

Microsoft Commits to November Release Date for Visual Studio 2008 -

Today, during the keynote address at Microsoft TechEd Developers 2007, S. “Soma” Somasegar, corporate vice president of the Developer Division at Microsoft Corp., announced that Microsoft will release Visual Studio 2008 and the .NET Framework 3.5 by the end of November 2007.... more
http://www.microsoft.com/presspass/press/2007/nov07/11-05TechEdDevelopersPR.mspx

Cheers - Dipesh

Wednesday, October 03, 2007

Source code for .net framework 3.5 libraries and debugging into it using VS 2008

Now you can download and browse the source code of the .NET Framework libraries (3.5), and easily debug them as well using VS 2008.

Source code (with source file comments included) for the .NET Base Class Libraries include as of now -System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text.... etc.
ASP.NET (System.Web), Windows Forms (System.Windows.Forms), ADO.NET (System.Data), XML (System.Xml), and WPF (System.Windows). more will be added in coming months by Microsoft.

You'll be able to download the .NET Framework source libraries via a standalone install (allowing you to use any text editor to browse it locally).

To learn more about our source release plans and how the above debugger integration works, please check out this Podcast that Scott Hanselman and Shawn Burke recently recorded. Shawn (who drove the source project on my team) is also going to be publishing a cool Channel9 video later this week that shows using the VS 2008 integrated debugging support with it.
More on Scott gu's blog .... Cheers - Dipesh

Wednesday, September 19, 2007

CRM import export tool for Roles...

If you are looking for CRM import export tool for Roles for CRM 3.0 here it is -

https://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=E55885A7-85A3-48C7-ABEE-B78F0E3D75AA

Credits to Mitch Fuller for bringing this to attention.
Cheers - DJ

Tuesday, September 18, 2007

Crm code 0x80040217 "The specified object was not found"

I have been faced lot many times by this generic .net error from CRM web service. Everytime it let me spend some time in figuring what this error was about ... and i learnt that this type of errors usually occur because of the mismatch/change of CRM metadata or data (GUID) for that record not matching. This can happen anytime when you are trying to do Insert, Update or Delete against CRM.

Easy Solution - Try catching Soap Exception instead of Generic .net Exception and see InnerXML message and it shows CRM code: 0x80040217 with description like: "Missing field/attribute" or it just says plain "Platform".
  1. If you are doing an insert check that all fields that you are using in the query/fetchXML are not misspelled.
  2. If you are doing an Update or delete check the above and ensure GUID you are using does exist in CRM database.

That should be the catch! Write to me if that does not solve your problem. Thanks - Dipesh

Yahoo mashup

Yahoo mashup at developer yahoo.com -
http://developer.yahoo.com/maps/applications.html

Learn simple "how to use" Yahoo mashups in .net - http://developer.yahoo.com/dotnet/

HOWTO Articles -
Get comfortable using .NET with Yahoo! Web Services
HOWTO: Make Yahoo! Web Service REST calls with C# and VB.NET
HOWTO: Using Returned XML with C# and VB.NET
HOWTO: Cache API Calls Using C# and VB.NET
HOWTO: Access Yahoo! Web Services Using XAML (my favourite)
HOWTO: Browser-Based Authentication Using C# and VB.NET

Regards - Dipesh Joshi

Zimbra and its AJAX-based collaboration suite...

Yahoo picks up Zimbra and its AJAX-based collaboration suite to compete with Google, Microsoft and IBM: http://www.eweek.com/article2/0,1895,2184226,00.asp?kc=EWKNLNAV09182007STR3) – it’s a pretty interesting messaging & collaboration environment (heavy use of AJAX).

Zimbra offers an AJAX (Asynchronous JavaScript and XML) client that bundles e-mail, contacts, shared calendar, search and VOIP (voice over IP) that can be used both on and offline, will help it expand its presence in universities, businesses and through ISPs. http://www.zimbra.com/demos/zimbra_overview.html

Regards - Dipesh

Monday, September 17, 2007

Reflector that allows you to disassemble entire Silverlight sites...

Check this Reflector plug-in that lets you disassemble entire Silverlight sites with ease. Check out those cool Silverlight sites http://www.tafiti.com/ and diagnoize it!

http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=SilverlightBrowser&referringTitle=Home

Happy learning and copying! :) Cheers - Dipesh

Download Silverlight 1.1 here...

Download Silverlight 1.0 here -
http://msdn2.microsoft.com/en-us/silverlight/bb187452.aspx
Install this to enhance browsers on Windows and Macintosh (for Internet Explorer, Firefox and Safari).

Download Silverlight 1.1 Alpha here -
Silverlight 1.1 Alpha September Refresh
Install this developer-only version to enhance browsers on Windows and Macintosh (for Firefox and Internet Explorer).

Download more here on MSDN

Thanks - Dipesh

Wednesday, September 12, 2007

Hanselmean wicked code links - NGenerics

NGenerics - "A class library providing generic data structures and algorithms not implemented in the standard .NET framework." This is cool code because it's not only adding new data structures, but also extending existing ones. They've added an IVisitor interface to add the Visitor pattern to create the VisitableHashTable amongst others.

More ... [1] - http://www.hanselman.com/blog/TheWeeklySourceCode5.aspx
Cheers - Dipesh

Tuesday, September 11, 2007

Tafiti

Check the implementation of cool Silverlight application here - http://www.tafiti.com/
Cheers - Dipesh

Friday, September 07, 2007

Scott Hanselman's 2007 Ultimate Developer and Power Users Tool List for Windows

Scott Hanselman has compiled a great list of .net tools a Developer must have...

It includes few of the ASP.NET Must Haves and Visual Studio add in's like -
UrlRewriting.NET - An open source URL rewriter, implemented as an HttpModule.

Web Development Helper - that allows ASP.NET 2.0 built into a Browser Toolbar.
Blinq - A tool for generating ASP.NET websites for displaying, creating, and manipulating data based on database schema.....and many more Visual studio add in's.

Check for details at his site at: http://www.hanselman.com/tools

Happy programming!

Thursday, July 26, 2007

Visual Studio 2008 Beta 2 and Silverlight RC1...this Friday!

Microsoft announced the availability today of the second beta version of its upcoming Visual Studio 2008 developer tools and the last version of its Silverlight rich media software code before the final version ships.

The second version of VS 2008, which is still scheduled to ship before the end of the year, includes a Silverlight add-in that allows developers to start building Silverlight rich Internet applications in VS 2008 and work with designer colleagues using the new Expression Web design tool, Microsoft said. With this beta release, VS 2008 is 99% complete, according to a Microsoft spokeswoman.

Scott Guthrie, general manager of Microsoft's developer division, noted in a blog post yesterday that one of the biggest features Web developers will discover in this beta version of VS 2008 is a "dramatically improved HTML designer" and rich Cascading Style Sheets (CSS) support. VS 2008 now uses the same Web designer that ships with Microsoft's new Expression Web design tool, he added.

"In addition to providing lots of new functionality, you'll also find that this Web designer is much faster than the VS 2005 version (which was based on a much older code base)," he wrote.

VS 2008 adds "split view" editing so that developers can see both the HTML source and design view at the same time and have changes made in one view be updated in the other, he added. The version also includes a new tool window that shows the CSS and the corresponding rules for the page a developer is editing. It can be used from within the design view or source view of a page.

Microsoft also announced the second beta version of the .Net Framework 3.5, which now includes full project template and tools support for many of the .Net Framework 3.0 compatibilities previously provided.

More...

Cheers - Dipesh Joshi

Monday, July 16, 2007

Acropolis July CTP now available for download...

Acropolis July CTP now available for download

The July CTP of Acropolis includes work to improve transition animations, better design time support, simpler support for custom themes, and various bug fixes. Start working with the CTP today.

Check some interesting videos here - http://windowsclient.net/learn/videos.aspx

Learn more - http://windowsclient.net/
Cheers - Dipesh Joshi

Scrum

Over this weekend I came across one more agile development technique called as "Scrum". I watched a video on microsoft site talking about scrum...which was very boring :) However reading wikipedia was fun. I was not aware that scrum is also kind of a group formation in rugby game (because of my lack of knowledge in this game, this term should be used in cricket too :)

However, i am just writing this offtopic because it was fresh in my mind and what i observe in my project. This is more of an agile kind of management but i don't think this seems to be effective for long duration complex projects. My 2 cents! :)

However, it was good to know ... learn more on wiki by typing scrum. Cheerio - Dj

Saturday, July 07, 2007

How do you bring web site down so that users cannot access any page for new patch release or upgradation of release?

How do you bring web site down so that users cannot access any page for new patch release or upgradation of release? There are ofcourse numerous ways to do that but one of the easiest way in .net 2.0 is copying Application offline (app_offline.htm) htm file into the root directory of the web site. Users will not get 404 or other HTML error pages but user friendly HTML (app_offline.htm) page.

Here's quick video which shows the demonstration...


HTH - Dipesh

Friday, July 06, 2007

What is MDM ? Master Data Management

So with the news that Microsoft has acquired MDM expert provider company Stratature there is a whole new thrill in the software and particularly in the SOA market to know how MDM fits into the bigger picture.

Update from Microsoft - www.microsoft-watch.com/content/business_applications/microsoft_bi_goes_mdm.html

So what is MDM ? here's what you find a definition when you search on Wiki -
"Master Data Management (MDM), also known as Reference Data Management, is a sub-discipline of Data architecture within Information Technology (IT) that focuses on the management of reference or master data that is shared by several disparate IT systems and groups. MDM is required to enable consistent computing between diverse system architectures and business functions.

Large companies often have IT systems that are used by diverse business functions (e.g., finance, sales, R&D, etc.) and span across multiple countries. These diverse systems usually need to share key data that is relevant to the parent company (e.g., products, customers, and suppliers). It is critical for the company to consistently use these shared data elements through various IT systems.

Most enterprises have implemented their own special blends of ERP, CRM, Business Intelligence, Financial Reporting, Planning, and other operational systems in order to accommodate unique business requirements. Each of these systems requires the same dimensional information to operate, yet they manage this information independently, which directly affects dimensional synchronization and reconciliation across systems. Master data management software aims to integrate dimensional and master data across BI, data warehouse, financial and operational systems, providing for accurate, consistent and compliant enterprise reporting.

Master data management can go beyond data integration. MDM generally has a data governance component. Data governance means having to define clear data owners and users, having clear business policies regarding what is good master data and what is not. Master data management is also about providing continuous reports and alerts to master data owners and the stewards regarding the health of the master data."



Check more on MDM at Wikipedia site - http://en.wikipedia.org/wiki/Master_Data_Management

More details in MS article - http://msdn2.microsoft.com/en-us/library/bb190163.aspx

MDM doesn't seem to be like a new concept but it's getting more visibility now! Let's see how far this can succeed and fit the SOA bill! Cheers - Dipesh

Thursday, July 05, 2007

Useful Tools (Reflector and addins)

Do you need a -
Tool to analyze .net assembly and show design quality metrics ?
Tool to quickly create class diagram ?
Tool to generate code to write unit tests, stubs and wrappers ?
Tool to draw sequence diagrams ?

Find all addins here at codeplex -
http://www.codeplex.com/reflectoraddins

Download .net reflector here

Mozilla releases Firefox 3 Alpha 6 (code name - Gran Paradiso)

Mozilla releases Firefox 3 Alpha 6 - low key launch... but according to the Alpha 6 release notes this version includes:

Updated SQLite engine to version 3.3.17;
Support for site-specific preferences--text size;
A new Quit dialog box that resolves termination errors;
Added permanent 'Restart Firefox' button to Add-Ons Manager;
Miscellaneous fixes to download manager including correctly displaying large file sizes; various Places fixes;
and miscellaneous Gecko 1.9 bug fixes.

Source: http://news.com.com/8301-10784_3-9740050-7.html?part=rss&subj=news&tag=2547-1_3-0-5

Tuesday, July 03, 2007

Microsoft .NET Framework 3.5 June 2007 Community Technology Preview (CTP) release...

Microsoft .NET Framework 3.5 June 2007 Community Technology Preview (CTP) is here...
http://www.microsoft.com/downloads/details.aspx?FamilyID=E6FD8663-8B77-4649-8D36-3830E18528FA&displaylang=en

.NET Framework 3.5 builds incrementally on the new features added in .NET Framework 3.0, for example, Windows Workflow Foundation (WF), Windows Communication Foundation (WCF), Windows Presentation Foundation (WPF) and Windows CardSpace. In addition, .NET Framework 3.5 contains a number of new features in several technology areas. These new features have been added as new assemblies to avoid breaking changes. They include the following:

Deep integration of Language Integrated Query (LINQ) and data awareness. This new feature will let you write code written in LINQ-enabled languages to filter, enumerate, and create projections of several types of SQL data, collections, XML, and DataSets by using the same syntax.

ASP.NET AJAX lets you create more efficient, more interactive, and highly-personalized Web experiences that work across all the most popular browsers.

New Web protocol support for building WCF services including AJAX, JSON, REST, POX, RSS, ATOM, and several new WS-* standards.

Full tooling support for WF, WCF, and WPF, including the new workflow-enabled services technology.

New classes in .NET Framework 3.5 base class library (BCL) address the most common customer requests.
Time is ticking :) Cheers - Dipesh

Sunday, June 24, 2007

Release plan MS CRM 3.0 Update Rollup 2.0

Microsoft CRM Sustained Engineering plans to release Microsoft Dynamics CRM 3.0 Update Rollup 2 Monday, June 25th. Update Rollup 2 is a well tested, cumulative set of updates for Microsoft Dynamics CRM Server 3.0 and Microsoft Dynamics CRM client for Outlook 3.0, including performance enhancements, which are packaged together for easy deployment.

Comprehensive information about this release will be available via the Microsoft Knowledge Base article 927751, which will be simultaneously published with the Rollup packages on the Microsoft Download Center. When published, the Update Rollup 2 packages will be available via http://www.microsoft.com/downloads/details.aspx?FamilyId=81674DA5-FFEF-492A-A7B1-7E1F1951B05F

This update rollup includes packages for Microsoft Dynamics CRM Server and Microsoft Dynamics CRM client for Outlook 3.0 to maintain parity between the client and server components of Microsoft Dynamics CRM 3.0.

Credits - Matt HTH - DJ

Tuesday, June 19, 2007

How to convert a structure/object/string into XML in .net and reverse?

How to convert a structure/object/string into XML in .net and reverse?

Check this -
http://www.dotnetjohn.com/articles.aspx?articleid=173

HTH - Dipesh

How to get name value from a CRM lookup - Primary Field/ Primary value diff?!

How to get name value from a lookup in CRM table?

if you have a lookup (foreign key) in your CRM table you can easily access its GUID but what if you want to get its name associated?

You may probably think that you may have to goto the parent table and pull name column value. Well, thats true but the easier way is to just append the name to the attribute in the referential table.

Example -
Guest (Primary table), has columns (GuestID, Name)
Reservations (Referential/child table), has columns (ResID, ResDate, .... GuestID(fkey/lookup type)

When you access Resrevations you can directly get GuestID (GUID) AND Guest Name (appending name) through the entity exposed by the CRM web service.

Check this -



More background on why this is or how this is check the Understanding CRM Metadata: PrimaryKey and PrimaryField article by MSCRM. Thanks - Dipesh

One liner - (Tips and Tricks) String pattern matching - RegEx()

Most of you know but sometimes we keep wondering best ways to do this. RegEx is the solution in .net for any type of string matching pattern.

More details on RegEx visit - http://msdn2.microsoft.com/en-us/library/az24scfc.aspx

RegEx is part of System.Text.RegularExpressions Namespace
How to verify if an email is valid in .net?
Trick -

bool IsValidEmail(string strIn)
{
// Return true if strIn is in valid e-mail format.
return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$");
}

How to remove/strip invalid characters from a string using RegEx in .net?
Trick -

String CleanInput(string strIn)
{
// Replace invalid characters with empty strings.
return Regex.Replace(strIn, @"[^\w\.@-]", "");
}

How to check if a particular character within a string is alphabet/char or alphanumeric or hexa?
Trick (alpha) - (checks if first char is alphabet)

return Regex.IsMatch(yourString.Substring(0,1), @"[a-zA-Z]");

HTH - Dipesh

Sunday, June 17, 2007

E-bay to go....

E-bay all set to have ebay to go! You can have search results for any of your fav. items and copy the code on ur website and get paid :) So now someone can browse ebay site from outside world too :) Cheers - Dipesh

You tube launches online editing tool to mix video clips with images and music...

"You tube" http://youtube.com launches online editing tool that allows users to mix video clips with images and music... way to go!
This is piggybacked upon the tool that Adobe developed. Yahoo has already implemented this! Check out urself by remixing videos on youtube.com. Cheers - Dipesh @ Jun 17th 2007

Saturday, June 09, 2007

Microsoft Service Oriented Architecture (SOA) webcasts...

Check the upcoming Microsoft webcasts on Service Oriented Architecture (SOA) -

SOA Overview
Tuesday, June 12, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

Learn how the Microsoft Service Oriented Architecture (SOA) vision and technology can help you realize a more agile and connected enterprise by using an IT infrastructure that can help streamline business processes, increase customer responsiveness, and improve interactions with key partners.

Presenters: Kris Horrocks and Yumay Chang, Microsoft Corporation

To register and join this webcast:

1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6818538


Messaging & Communications
Friday, June 15, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

Applications commonly communicate with other applications, both inside and outside the organization. Modern applications also must often fit into a service-oriented architecture (SOA), exposing some of their functionality as interoperable services accessible by other software. Achieving these goals requires support for service-oriented applications to communicate with other services.

In this session we’ll share with you the technology Microsoft provides to build web services that support the latest WS-* standards endorsed by all major vendors. In addition, we’ll tie it in with the previous discussion around Software Factories and show how Microsoft supports rapid development of these services through tooling support.

Presenters: Steve Swartz and Don Smith, Microsoft Corporation

To register and join this webcast:

1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6818539


Business Process & Workflow
Tuesday, June 19, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

In this session we will discuss the Business Process and Workflow capabilities necessary in service oriented architecture and provide guidance for selecting the most appropriate technology from Microsoft’s portfolio. We will discuss the requirements for service composition in client applications, composite services, service intermediaries, and line of business applications. In addition, we will examine the differences between general purpose workflow platforms, domain specific workflow products, and cross organization business process concerns.

Presenters: Kris Horrocks, Microsoft Corporation

To register and join this webcast:
1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6818540

Tools & Modelling
Friday, June 22, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

The advance in tooling has allowed business to drive down the cost of development by over 100% in the last 10 years. However, in the same period of time the number of successful projects has not increased significantly. In fact it has consistently run at right around 30% of projects are deemed successful. Software development, as currently practiced, is slow, expensive and error prone, often yielding products with large numbers of defects, causing serious problems of usability, reliability, performance, security and other qualities of service.


This talk addresses how to identify typical customer pains in software development and shows how Microsoft tools offer a solution that enables collaboration across the extended team of project managers, architects, developers, testers, and business stakeholders and allows new solutions to be developed faster, cheaper and better though industrialization of software development.

Presenters: Erik Gunvaldson, Don Smith, Microsoft Corporation

To register and join this webcast:

1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6818541


SOA Workshop Series: Enterprise Service Bus
Friday, June 29, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

This webcast explores the service oriented capabilities necessary to support mediated service communication and our guidance for implementing an Enterprise Service Bus (ESB) on the Microsoft platform. In addition, we will discuss the increasing need for broadly available service bus capabilities beyond the edges of the enterprise.

Presenter: Kris Horrocks, Microsoft Corporation

To register and join this webcast:

1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6834394

SOA Workshop for Architects: Identity and Access
Tuesday, July 10, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

The main reason that identity is now such a hot topic is based upon the fact that there is more opportunity to connect. High bandwidth communications via the Internet are now almost ubiquitous and span a broad range of scenario within organizations, between organizations, at home and elsewhere This has resulted in a rapid increase in the adoption of products and services available via the internet, and many of these services require some form of user authentication, but with the proliferation of phishing schemes there is no safe way to say who you are on the internet.

In this session we will show you Microsoft’s solution on identity and access can addresses these common concerns presented by the web, and how through identity federation a user can access services that require a different set of credentials in a transparent fashion.

Presenter: Kim Cameron, Microsoft Corporation

To register and join this webcast:
1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6834536

SOA Workshop for Architects: Governance and Management
Friday, July 13, 2007
8:00am (GMT-8) Pacific Time (US & Canada),
Language: English-American

As companies grow, their IT infrastructures grow along with them. But more often than not, the pace of that growth is uneven. As applications, functionalities and people are added across the board at various points in time, the complexity of the enterprise multiplies and the harder it can be to manage and, more importantly, to keep secure.

A dynamic system is Microsoft’s vision for what an agile business looks like—where IT works closely with business in order to meet the demands of a rapidly changing and adaptable environment. Come hear about Microsoft’s technology strategy for products and solutions that help businesses enhance the dynamic capability of its people, process, and IT infrastructure using technology.

Presenter: Jeff Johnson, Microsoft Corporation

To register and join this webcast:

1. Click on (or enter in your browser) the address of the registration page:
http://go.microsoft.com/?linkid=6834551

Credits - Lisa McIntosh, Regards - Dj

Friday, June 08, 2007

Online word processor, site monitoring, online sheet and more with Zoho notebook...

Hello All - Need an Online word processor, 24x7 site monitoring, online word sheet without downloading any software ... check Zoho notebook...

I saw this demo of Zoho Notebook... thought of sharing this with you all, must watch video: http://blogs.zoho.com/general/zoho-notebook-launches/

Zoho has huge online stable products like:
- Zoho On-Demand CRM Solution (good one, i liked the idea :)
- Zoho Online Word processor (no download)
- Zoho 24x7 site monitoring
- Zoho Wiki too!

Check out more if you are interested in buying their products at http://www.zoho.com/ ... Sounds more like my manager Sooho :”)
Cheers, happy weekend – Dipesh

Online word processor, site monitoring, online sheet and more with Zoho notebook...

Hello All - I saw this demo of Zoho Notebook... thought of sharing this with you all, must watch video: http://blogs.zoho.com/general/zoho-notebook-launches/

Zoho has huge online stable products like:
- Zoho On-Demand CRM Solution (good one, i liked the idea :)
- Zoho Online Word processor (no download)
- Zoho 24x7 site monitoring
- Zoho Wiki too!

Check out more if you are interested in buying their products at http://www.zoho.com/ ... Sounds more like my manager Sooho :”)
Cheers, happy weekend – Dipesh

Georgian to Julian date - C#

How do i convert from Georgian date to Julian Date in .net 2.0 - C#?
Very simple..... but thought of sharing this because i got confused myself for a second.

btw, quick intro Georgian dates are the one's that we normally use in our day to day life - mm/dd/yyyy format or similar. Julian dates are more like numbers that we find in Excel kind of tools. I came across this when i had a requirement where one of the web service was expecting Julian kind of format. So to cut the crap... this one line of code helps you to convert from Georgian date format to Julian in .net -
private static string GetJDate(DateTime gdate)
{
// Georgian date - "06/07/2007" Julian date - "39240";
return gDate.ToOADate().ToString();
}

Cheerio - Dipesh Joshi
Coming soon - Please spare some time to check my videos soon on YouTube and Google videos :) (I will update this post)

MS Dynamics CRM 3.0 - Exchange Server 2007

If you are looking out for an update to Microsoft Dynamics CRM 3.0-Exchange E-mail Router this link below provides you support for Microsoft Exchange Server 2007.

http://www.microsoft.com/downloads/details.aspx?familyid=f7656f0f-4195-4a7d-b654-2786787e1422&displaylang=en&tm

Cheers - Dipesh

Tuesday, June 05, 2007

Google Gears... Get your applications working even when offline!

You can now make your web applications work offline! So, you don't need internet to get connected? Partially true....

Check this simple application (install google gears first) - http://code.google.com/apis/gears/samples/hello_world_database.html

Check the tutorial here - http://code.google.com/apis/gears/tutorial.html
Check the architecture here - http://code.google.com/apis/gears/architecture.html

Message here is clear - "Google" wants to have a solid client footprint... http://code.google.com/apis/gears

Get's interesting.. is it? :) Cheers - Dipesh

Google, Salesforce.com to partner on Web site

Salesforce.com and Google are expected to launch a combined Web site today (dated June 5th 2007) that is designed to allow the online customer relationship management software maker to act as a reseller for Google's AdWords.

So Google allows you to insert ads into your video stream now (it's already in beta!). The customers that want their ads published will be maintained in this online CRM tool developed by Salesforce.com. This will be mostly targeted to small and mid companies. Check the news here - http://news.com.com/8301-10784_3-9725819-7.html?part=rss&subj=news&tag=2547-1_3-0-5

Cheers - Dipesh

Friday, June 01, 2007

CRM "object type" code changes for different environments...

Did you know that the CRM entity "object type" code changes for different environments in QA and development. I didn't know that but Gaurav posted this question to the community to see if there was a way by which we can sync up these object types in development and QA.

Unfortunately, there is NO straight way to keep them in sync! However, you can use the metadata webservice to retrieve the correct objecttypeid for a particular entity. Check CRM SDK or let me know if you need the code. Thanks - Dipesh

CRM insert issue "Unable to connect to the remote server " ...force sleep

Hello – I was almost pulling out my hair with this CRM insert issue "Unable to connect to the remote server "… :)
I have written a small console based utility in net 2.0 … which tries to insert 7000 odd records (custom entity property records) into CRM. I am using CRM webservice to do this.

However, before inserting into CRM I am checking if property record already exists in CRM database or not. I am using "RetrieveMultiple" to search a particular property record and accordingly insert or update one in CRM.

Everything works fine if I run the utility from my computer (client computer) to populate the CRM Dev database but when I try to run this utility from the Dev server itself (through remote desktop connection) after loading 3000 odd records it keeps on failing at RetrieveMultiple() statement. The exception it shows is as below -

----------------------------------------------------------------------------------------------
Error: --- > Unable to connect to the remote server

Stack Trace: ----- > at System.Net.HttpWebRequest.GetRequestStream()

at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

at MS.Data.CrmWebService.CrmService.Create(BusinessEntity entity)

at MS.Integration.RIM.Program.PopulatePropertyEntity(CrmService crmService, Ratings retFR_Mobil)
-----------------------------------------------------------------------------

Initially, I thought this would be occurring because of bad data but I figured that if I rerun the utility to start from 2999 again then it works fine again and stops randomly after loading 1000 odd records or so again.

So I was pretty confident that this may NOT be because of bad data! It also ran from my machine just fine.

So the question was "Does the CRM web service time out after few inserts"
OR
Does CRM have limitations while inserting records quickly?

Solution - I tried doing a force sleep for 30 secs and it worked fine. For you if this doesn't work then try these steps -

This may also be caused by the number of ports available in IIS - every create method will be creating a new connection to the server, and after a certain period, all the available ports are used up and no new connections can be made.

I recommend looking at the article here on Performance [1] and setting the UnsafeAuthenticatedConnectionSharing on the CrmService to true. This *should* then only create one connection and re-use it for all your data inserts.

[1] http://blogs.msdn.com/crm/archive/2007/01/09/best-practices-for-better-performance-from-your-custom-code.aspx


Credits to Rich for psting me on this. Rich you are the man! :)
HTH - Dipesh

Some more videos on Surface technology...

Some more videos on Surface technology... check the Touchtable video

Interesting demo on Surface on Channel 10 http://download.microsoft.com/download/a/9/5/a9579d84-bb59-4fab-bf4c-53008a8a9b6e/MicrosoftSurfacing_on10.wmv

I liked this... this is evolutionary i think :)
Waiting this winter 2007 to learn more...
Cheers - Dipesh Joshi

Wednesday, May 30, 2007

"Microsoft Surface" is here...


Surface is here - http://www.microsoft.com/surface/

“With Surface, you can actually grab data with your hands, and move information between objects with natural gestures and touch…”

“You can plan a day of sightseeing without leaving your hotel lobby…”



Explore...
Cheers - DJ

Tuesday, May 29, 2007

Tool to convert vb.net code to c# - Sharp Develop

Ever felt the need for a tool to convert "vb.net code to c#"? Try Sharp Develop.

#develop (short for SharpDevelop) is a free IDE for C#, VB.NET and Boo projects on Microsoft's .NET platform. It is open-source, and you can download both sourcecode and executables from this site.
Check the download section and more on http://www.icsharpcode.net/OpenSource/SD/ for tools to convert your VB.net code to C# and vice versa as well! Cheers - DJ

How do i import data from Outlook, lotus notes or any other data source into CRM 3.0?

How do i import data from Outlook, lotus notes or any other data source into CRM 3.0?

Every organization has data stored online about customers, products, leads, contacts, contracts, sales literature, competitors, and more. Perhaps you transferred this data to Microsoft Dynamics CRM 3.0 as part of your initial implementation or found or purchased data after everyone was already using Microsoft CRM. However you got the data, you can automate the process of importing it into Microsoft CRM so that no one has to manually re-enter the data.

Microsoft CRM includes five tools for importing data, each of which is designed for specific source data:

• Bulk Import Wizard

• Data Migration Framework

• Data Migration Wizard for Microsoft Office Outlook with Business Contact Manager

• Microsoft Dynamics CRM Connector for Microsoft Dynamics GP

• Microsoft CRM SDK
---------------------------------------------------------------
• Bulk Import Wizard -
The Bulk Import Wizard is useful for importing lists of names you have purchased or collected by other means. The data to import must be stored in a comma-delimited values (CSV) file or in a text file delimited with semicolons, colons, or tabs. The Wizard can be used only to import data into the Lead, Account, Contact, and Campaign Response areas of Microsoft CRM, including importing any custom attributes for these areas. Leads, accounts, and contacts can be imported directly to a marketing list. For example, one common use of the Bulk Import Wizard is to import contacts that have been exported from Microsoft Outlook into a CSV file. Another common use is to import data from a marketing list you purchased.
The Bulk Import Wizard cannot import notes and attachments!

• Data Migration Framework -
Data Migration Framework helps you to import data from any other data source. it is free and provided by Microsoft. Download Data migration framework

Check 5 ways to import data into CRM 3.0 as well.
HTH - Dipesh

Tuesday, May 22, 2007

How to set status of an custom entity to inactive?

How to set status of an built in entity like Account or custom entity to inactive?

Below is the code sample for SetState/Status to inactive for a system entity...[C#]

// Standard CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the request object.
SetStateAccountRequest state = new SetStateAccountRequest();

// Set the properties of the request object.
state.AccountState = AccountState.Inactive;
state.AccountStatus = -1;

// EntityId is the GUID of the account whose state is being changed.
state.EntityId = new Guid("AD618DB2-F0DB-4A6A-8C4B-2F2213EAA38E");;

// Execute the request.
SetStateAccountResponse stateSet = (SetStateAccountResponse)service.Execute(state);

If you want to set the status/state to a dynamic entity then use the following -
SetStateDynamicEntityRequest req = new SetStateDynamicEntityRequest();

req.Entity = new Property();

//Primary key of record
req.Entity.Id = new Guid("{AAD5DA71-34E3-DB11-90D0-0003FF873FE6}");
req.Entity.Name = "new_customentity";

req.State = "inactive";
req.Status = -1;
//req.State = "active";
//req.Status = 1;

service.Execute(req);


you have to use these provided classes to get the status inactive for a particular record in CRM. You cannot use StatusCode and StateCode to set these values directly to the entity as it did not reflected to me on the UI grid. However, Execute did wrk. Thanks - Dipesh

"Scribe" ...answer to migration from legacy systems

1> Want to migrate contacts from Outlook into your CRM application?
2> Want to migrate data from existing CRM apps like Siebel and sf.com into your CRM?
3> Want to automatically feed leads into Microsoft Dynamics CRM from a Web site?
4> Want to populate customers in Microsoft Dynamics CRM with financial and order history data from ERP?
5> Want to proactively monitor key customer activity through automated alerts sent to e-mail, cell phone, or Microsoft Dynamics CRM?
6> Want to enhance and validate data from third-parties via Web Services or data feeds
7> Want to synchronize customer data in real time between Microsoft Dynamics CRM and other applications ?

Check the Scribe tool that allows you to do all this in real short time compared to spending your own development cycle! Follow the simple installation steps outlined here - http://blogs.msdn.com/mscrmfreak/archive/2007/04/22/Improved-Scribe-Installation-Guide.aspx

Cheers -Dipesh Joshi

Thursday, May 17, 2007

Write Callouts using VS 2005 using this template...

knock knock... I was trying to write my first callout because i need to send some real time data to third party application from my CRM. So on click of Save (postCreate) i wanted to do something. Anyways, my box has got no VS 2003 installed and i learnt that callouts can only be written in VS 2003 because CRM was built in .net 1.1 framework. So i thought ok, i need to install VS 2003 ... means already crunching space woes adds up! but then i found this great atricle on Arash's blog which tells me that i need not install VS 2003...viola! :)

You can write callouts using VS 2005 if you got .net framework 1.1 only! Arash has written a template that you can download it from here - http://blogs.msdn.com/arash/attachment/719626.ashx (its a .msi, so fully automated) and you are good to go. Check his article here - http://blogs.msdn.com/arash/archive/2006/08/25/719626.aspx

If you choose to create your own template then visit Jomo's blog - http://blogs.msdn.com/jomo_fisher/articles/410896.aspx He has explained it beautifully here. You need to know MSBUILD a little to get this manually done. I prefered MSI built by Arash ...it helped me a lot! Cheers - Dipesh Joshi

Changing the web service URL dynamically in .net

How do I change the web service URL's dynamically across projects in VS.net?

If you do not want to hard code your web service URL's into your project then there's a way out!
1> You can add web reference in VS.net and change the web service property to dynamic.

What we did -
2> Create a utility class and added this static method -
public static CrmService GetCrmService()
{
CrmService crmService = new CrmService();
crmService.Url = Client.Sample.Data.Properties.Settings.Default.Client_Sample_Data_CrmWebService_CrmService;
crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;
crmService.PreAuthenticate = true;

return crmService;
}

3> In the same utility class add Settings file (VS 2005) and add webservice URL's there. Settings is a user friendly GUI ...so add webservice_URL = "\Test.asmx".

4> Save the settings file. The changes once saved would get synced up/updated in app.config available in Utility project. All settings should reflect in applicationSettings in App.config.

5> Copy this section of application settings into your web.config or any config file under any project... reference the utility class (.dll) we just created.

6> Call the static method from your app/project and you should copy paste applicationSettings from utility app.config into your config file.

You should now be good to go. Just change the URL's in your web.config file and without compiling you should be good to go.

Cheers - Dipesh Joshi

GhostDOC VS addin to generate XML documents...

One of the tools that you would like to have as an MS Visual Studio addin - GhostDOC !

XML comments are invaluable tools when documenting your application. Using XML comments, you can mark up your code and then, using a tool like nDoc, you can generate help files or MSDN-like Web documentation based on those comments. The only problem with XML documentation is the time it takes to write it you often end up writing similar statements over and over again. The goal of GhostDoc is to automate the tedious parts of writing XML comments by looking at the name of your class or method, as well as any parameters, and making an educated guess as to how the documentation should appear based on recommended naming conventions. This is not a replacement for writing thorough documentation of your business rules and providing examples, but it will automate the mindless part of your documentation generation.

http://www.roland-weigelt.de/ghostdoc/

After installing GhostDoc, you can right-click on the method declaration and choose Document this.

Don't stop hereyou should add additional comments stating where the person is being saved to or perhaps give an example of creating and saving a person.
Adding these extra comments is much easier since the basic, redundant portion is automatically generated by GhostDoc. GhostDoc also includes options that allow you to modify existing rules and add additional rules that determine what kind of comments should be generated.

GhostDoc was written by Roland Weigelt and can be downloaded for VS 2005, VS Orcas as well from www.roland-weigelt.de/ghostdoc

HTH, Thanks - Dipesh

Wednesday, May 16, 2007

Filtered Views in CRM 3.0

Did you know that apart from FetchXML (v 1.2 carry on) and Query Expression (v 3.0 faster, powerful approach) we also have FilteredViews in CRM 3.0 by which we can query the CRM database.

FetchXML and QueryExpression give you information from CRM database via CRM web service but FilteredViews allow you to retrieve data from CRM directly hitting the SQL. Microsoft does not recommend you to access the CRM - SQL database directly for any manipulations but if you want to just retrieve(read) the records from CRM entities(built in + custom) it's absolutely fine to do so using Filtered Views.

One of the reason we would like to use FilteredViews is because we needed information from multiple entities. You cannot use QueryExpression for that in CRM 3.0 but sure can use FetchXML.
See my previous post

The problem with FetchXML is the flat structure it returns (as i mentioned in my prev posts). With FilteredViews you have the liberty to work the way you did in SQL server. You get the power of SQL DML usage and ADO.net (can also use features like GroupBy, multiple joins easily etc.)

However do NOT attempt to insert/update records directly into CRM database.

Here's an explanation on FilteredViews -

If you were to browse the Microsoft CRM SQL database (with a tool such as SQL Server Enterprise Manager or SQL Query Analyzer), you might notice multiple data objects related to Accounts, including:

1> AccountBase table
2> AccountExtensionBase table
3> AccountLeads table
4> Account view
5> FilteredAccount view

When you want to write your own custom report about Accounts, you might wonder which of these database objects includes the information you're looking for.

Fortunately, instead of forcing you to spend hours investigating what types of entity data CRM stores and what relationship exists between these objects, CRM has simplified reporting for us by offering "filtered views". Filtered views perform the cumbersome task of denormalizing multiple tables and relationships into a streamlined view of entity and system data. In addition, filtered views respect the CRM security settings so that users who query filtered views (or run reports that query filtered views) will see only the data that they're allowed to see.

Two different users viewing the same report might see entirely different results depending on the Microsoft CRM security settings. This feature will save you hours by trying to manually determine the security and data settings of each custom report.

These objects (as listed above) are also created for all custom entities that we create in CRM.

Also, filtered views translate lookup fields and picklist values, and they calculate all datetime values in both Coordinated Universal Time (UTC) and the user's localized value.

HTP, Cheers - Dipesh

Connection string with Windows and SQL Server authentication...

Useful one thought of sharing this - Here's a whole site with information on just Connection strings for different databases.
ConnectionStrings.com

Quick one for .net/SQL -
Integrated Security=True - If you want to use windows authentication (takes windows credentials)
SqlConnection connection = new SqlConnection("Data Source=;Initial Catalog=;Integrated Security=True; ");

Integrated Security=False - If you want to use SQL server authentication (provide user name and password and this loging shud be present in SQL 2005)
SqlConnection connection = new SqlConnection("Data Source=;Initial Catalog=;Integrated Security=False; Uid = <'sql login name'> Pwd =<'sql pwd'> ");
Credits - Gaurav for healthy discussion. Cheers - Dipesh

IIS Logs and Log Parser utility...

Did you know ... in addition to the Windows Server 2003 system and security logs, you should configure IIS to log site visits. When users access your server running IIS 6.0, IIS logs the information. The logs provide valuable information that you can use to identify any unauthorized attempts to compromise your Web server.

Depending on the amount of traffic to your Web site, the size of your log file (or the number of log files) can consume valuable disk space, memory resources, and CPU cycles. You might need to balance the gathering of detailed data with the need to limit files to a manageable size and number. If you are planning to put thousands of Web sites on one Web server with high traffic volumes and disk writes, you might want to use centralized binary logging to preserve server resources. Also, consider limiting log size by changing the frequency of log file creation.

For more information check MS site here - http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b344f84e-bc77-4019-859c-9d483bc85c77.mspx?mfr=true

Ok, you can convert your IIS logs into SQL database as well so that you can do more efficent reporting
Also, you can write your custom logging modules and have logs displayed on ASP page as well. Check all about IIS logging here -


Do you need a tool to do all this - "Log Parser" (command line utility) :)
Log Parser allows you to do universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®.

Download it from here -
http://www.microsoft.com/downloads/details.aspx?familyid=890cd06b-abf8-4c25-91b2-f8d975cf8c07&displaylang=en

CRM 3.0 does not have functionality inbuilt for profiling transactions? To get reports like ...which user accessed Contacts, Case or a particular page number of times or any unauthorized access we need to use IIS logs to meet the needs. Credits to Ronald for sharing this info
Thanks - DJ

Friday, May 11, 2007

Thursday, May 10, 2007

Advanced Find to generate FetchXML for you....(single entity)

You can use Advanced Find in CRM tool to generate FetchXML for you instead of manually writing the string or using any other tool.

You can just open the Advanced find page and build the query as you like. Then run the query to see if it returns the data as you wish it should. If you are satisfied with the results and you want to know what query was sent into the CRM Framework, then press F11 to get the address bar and enter this script below and press enter.

javascript:prompt("my query:", resultRender.FetchXml.value);

I was able to get this working for single entity though.. for multiple entities i had a tough time. But the tool i mentioned in my earlier post http://archdipesh.blogspot.com/2007/05/how-to-retrieve-multiple-attributes.html helps me for multiple entities! Thanks - Dipesh

how to retrieve multiple attributes from multiple entities in CRM 3.0?

How to retrieve multiple attributes from multiple entities in CRM 3.0?

For all those who have tried using QueryExpression to retrieve attributes from multiple entities i am sure it is a hard try! But with no fault of your's this seems to be the limitation within CRM 3.0 as QueryExpression just returns one object. So really in CRM 3.0 if you want to return multiple attributes from more than 1 entity you will have to use the CRM 1.2 - FetchXML technique. Here's how the fetchXML looks.
Entities in example include - Property (parent) related to child Meeting Room entity and meeting room is related to Events entity.

You can use Count to restrict the number of records spitted.
Really, if you feel this is all confusing you can use James tool - http://jamesdowney.net/fetchxml.aspx to create an fetchXML for you real quick. It is free!



here's a sample code for FetchXML -
try
{
//set the CRM service instance
CrmService crmService = new CrmService();
crmService.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Retrieve the results.
string result = crmService.Fetch(fetchXML); //fetchXML is the string shown above
return result;
}
catch (System.Web.Services.Protocols.SoapException ex)
{
return ex.Message;
}

CRM gurus say that they MS will try to overcome this limitation in Titan release. Till then this workaround works fine!
1 issue i found hard to meet my requirement was that it spits back flat structure rather than defined hirearchy. The parent record( property in example above) is returned as an XMl element with every child record. I am not sure how do we achieve GroupBy similar to SQL in FetchXML?! Thanks - Dipesh

Tuesday, May 08, 2007

Writing your own Code Snippet...

You can write your code snippet and create a library for day to day coding tasks. This post on ArashSichanie explains you simple yet effective steps to do so.
http://blogs.msdn.com/arash/archive/2006/07/14/666114.aspx
This snippet in example can be used for CRM activity. Cheers - Dipesh

Creating an XML Document using XMLDom and returning string as response...

Some answers are so straight forward but you just dont find them when you need them. I am happy that i am maintaining this blog and hopefully the next time when i need these answers i come back here.... :)

This is the XML i am trying to create -


//Create XML document
XmlDocument xmlDoc = new XmlDocument();

//Write down the XML declaration
XmlDeclaration xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);

// Create the root element
XmlElement rootNode = xmlDoc.CreateElement("PropList");
xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement);
xmlDoc.AppendChild(rootNode);

//
//Create an XML element
XmlElement parentNode = xmlDoc.CreateElement("Prop");
//Create an XML attribute
XmlAttribute idAttribute = xmlDoc.CreateAttribute("PropID");
idAttribute.Value = i.ToString();
//Associate the attribute to the element
parentNode.SetAttributeNode(idAttribute);

xmlDoc.DocumentElement.PrependChild(parentNode);

//MEMSG
//Create an XML element
XmlElement newCityHocn = xmlDoc.CreateElement("CityHocn");
newCityHocn.InnerText = "MEMSG";
//Add this element as an child to Prop
parentNode.AppendChild(newCityHocn);

//1000121
//Create an XML element
XmlElement newSecFacilityID = xmlDoc.CreateElement("SecondaryFacilityID");
newSecFacilityID.InnerText = "1000121";
//Add this element as an child to Prop
parentNode.AppendChild(newSecFacilityID);
//


// Save to the XML file
//xmlDoc.Save(@"D:\test.xml");

//return string
xmlDoc.OuterXML;

If you are creating a web service and you want to return string as an response to the web method then use xmlDoc.OuterXML instead of saving to a file. String response will help non .net platforms to consume from web service as well.

Others - http://www.mastercsharp.com/article.aspx?ArticleID=69&&TopicID=9

Thanks - Dipesh

Orcas Beta 1 VPC download...Step 1

Rock on Orcas Beta ... if you want to get started this is the starting point -

1> Download the Base image (one-time only): VSCTPBase.exe (1.12 GB)

2> Download all parts of the Visual Studio Code Name Orcas Beta 1. The first part is a self-extracting EXE and will prompt for the other parts. Find the download for OrcasBeta1VSTS_VPC_8PartsTotal.part01.exe here - (700 MB)

http://www.microsoft.com/downloads/details.aspx?FamilyId=36B6609E-6F3D-40F4-8C7D-AD111679D8DC&displaylang=en

Find the steps to follow on the above URL as well to get your VPC working... no install needed. Get going now!

Thanks - Dipesh

Monday, May 07, 2007

Code snippets for daily coding tasks...

I am sure most of them know this .... but thought worth pointing this out -

IntelliSense Code Snippets are reusable, task-oriented blocks of code. Visual Studio 2005 includes code snippets covering tasks ranging from creating a custom exception, to sending an e-mail message, to drawing a circle. A set of Visual Basic and Visual C# Code Snippets are included in the Visual Studio 2005 box – additional Code Snippets can be found below.
http://msdn2.microsoft.com/en-us/vstudio/aa718338.aspx

Thanks - Dipesh

Saturday, May 05, 2007

Is there an easy way to change the default 5555 port CRM uses and are there any implications?

Is there an easy way to change default 5555 port CRM uses and are there any implications?

You can easily change the port settings in 2 places:
1> In IIS, go into the properties of the CRM website and enter the default port 80 or any preferred used port number.
2> In the registry under the MSCRM hive, update the ServerURL regkey.
That's it!

"You can also setup an IIS web site using the desired port prior to the install and have CRM use that website during the install vs. creating its own. There is no way to override the install’s use of 5555 for the site it creates though.

Due to some of the nuances of what CRM does with the site and how it handles host headers and such, it may be easier to uninstall/reinstall in this manner than to try to mess with the port."

Thanks to Will and Matt for explaining this. Hope this helps. Thanks - D

Thursday, May 03, 2007

ReSharper 2.5.2 Maintenance Release

The new evaluation scheme deserves a special mention. Simply put, we've made evaluation easier by eliminating evaluation licences. Just download, install and enjoy ReSharper for 30 days. We only ask for one thing: after you've tried the software, please select Submit Feedback from ReSharper menu and tell us your thoughts.
The full list of changes and enhancements is available at
http://www.jetbrains.com/resharper/releaseNotes252.html?rs252nl

You can download version 2.5.2 at
http://www.jetbrains.com/resharper/download/index.html?rs252nl

The latest maintenance release features multiple bugfixes and several enhancements, which include:
- Better ASP.NET support
- Join/split string context action
- Improved stability
- New evaluation scheme
The new evaluation scheme deserves a special mention. Simply put, we've made evaluation easier by eliminating evaluation licences. Just download, install and enjoy ReSharper for 30 days.
Cheers - Dipesh

Announcing: CRM SDK V3.0.7 Updated

Announcing an update to the Microsoft CRM 3.0 SDK! Download version 3.0.7 of the SDK to get new and updated sample code, topic enhancements, and bug fixes. Here are few of the changes you’ll find in this version:
Learn best practices for writing code that performs better by creating multiple threads and using unsafe connection sharing.
In the Sample Code section, you’ll find new samples that show you how to:
Create a customer relationship
Create an opportunity and set a picklist
Perform a bulk delete operation
You can download the updated SDK from this location: www.microsoft.com/downloads/details.aspx?FamilyId=9C178B68-3A06-4898-BC83-BD14B74308C5&displaylang=en. This update will be live on MSDN soon!

Tuesday, May 01, 2007

IE Developer toolbar...

If you're like most Web developers, when you were first learning HTML, you probably spent a great deal of your time playing around with your browser. The fact that you could simply do a "View Source" and see how an interesting web page was implemented was one of the things that helped HTML catch on so quickly. This "code sharing" is undoubtably one of the reasons the Web was able to grow as quickly as it did.
Unfortunately, these days it's not so easy to take a look at the magic going on behind the scenes of the average web page. With the emphasis on usability and appearance, the previously simple HTML has become incresingly difficult to read and these days most web pages are made up of a combination of several files and use often use as much CSS and client-side script as they do HTML. Using "View Source" simply doesn't cut it anymore. Luckily Microsoft has realized this fact and is building a tool to help developers analyze these increasingly complex web documents. It's called the Internet Explorer Developer Toolbar. In this article I'll give you a quick introduction to this powerful new tool and examine some of it's most useful features.

These features enable you to:
1 Explore and modify the document object model (DOM) of a Web page.
2 Locate and select specific elements on a Web page through a variety of techniques.
3 Selectively disable Internet Explorer settings.
4 View HTML object class names, ID's, and details such as link paths, tab index values, and access keys.
5 Outline tables, table cells, images, or selected tags.
6 Validate HTML, CSS, WAI, and RSS Web feed links.
7 Display image dimensions, file sizes, path information, and alternate (ALT) text.
8 Immediately resize the browser window to a new resolution.
9 Selectively clear the browser cache and saved cookies. Choose from all objects or those associated with a given domain.
10 Choose direct links to W3C specification references, the Internet Explorer team weblog (blog), and other resources.
11 Display a fully featured design ruler to help accurately align and measure objects on your pages.
12 Find the style rules used to set specific style values on an element.
13 View the formatted and syntax colored source of HTML and CSS.

Download the beta version from here - http://www.microsoft.com/downloads/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en

Check for details on IE developer tool here - http://www.15seconds.com/issue/070208.htm

- D

Convert XML data to object and back using serialization

Introduction -
This article shows you how to convert an XML to a class object and retriving back.

Saving XML to a class object is called serialization and reading back using the reverse process is called as deserialization.
1> Assuming you have a sample xsd, to convert a class from XSD, we would run the following command:

xsd C:\Contact.xsd /t:lib /l:cs /c from VS.net command prompt.
2> /// auto generated code from xsd command ran above...
using System.Xml.Serialization;
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public class Contact
{        
public ContactInfo;
}
public class ContactInfo
{        
public string Code;        
public string FirstName;        
public string LastName;        
public string Email;
}
 
3> Now, we could save an contact XML data to this class using this simple function:
public Contact ContactObject(string xml)  
{   
StringReader stream = null;   
XmlTextReader reader = null;   
try   
{    
// serialise to object    
XmlSerializer serializer = new XmlSerializer(typeof(Contact));
stream = new StringReader(xml); // read xml data    
reader = new XmlTextReader(stream);  // create reader    
// covert reader to object    
return (Contact)serializer.Deserialize(reader);   
}   
}
 
And to get the XML based on the Contact class object, use the following function:
public string ContactXML(Contact cont)  
{   
MemoryStream stream = null;   
TextWriter writer = null;   
try   
{    
stream = new MemoryStream(); 
// read xml in memory    
writer = new StreamWriter(stream, Encoding.Unicode) ;    
// get serialise object    
XmlSerializer serializer = new XmlSerializer(typeof(Contact));    
serializer.Serialize(writer, cont); 
// read object    
int count = (int) stream.Length; 
// saves object in memory stream    
byte[] arr = new byte[count];    
stream.Seek(0, SeekOrigin.Begin);    
// copy stream contents in byte array    
stream.Read(arr, 0, count);    
UnicodeEncoding utf = new UnicodeEncoding(); 
// convert byte array to string    
return utf.GetString(arr).Trim();   
}   
}
 
Hope this helps for all working on XML!
Thanks - DJ

Monday, April 30, 2007

MIX 07 conference

Visit MIX 07 conference at - http://visitmix.com
Check out the cool videos, sessions, hot topics and debates posted here.
Cheers - Dipesh

Silverlight and Expression Studio News... 1.0 Beta released

This MIX 07 conference has got something exciting in form of Siverlight.

Silverlight is a cross-browser, cross-platform plug-in for delivering the next generation of media experiences and rich interactive applications (RIAs) for the Web. The Silverlight 1.0 Beta has a go-live license that implies it can be used for commercial purposes.

What has it got for you?
· Cross platform .net framework through Silverlight (full Visual Studio experience)
· Perf when using C# instead of js to create rich internet apps is 300-1000 times faster
· Silverlight Visual Studio add-in enables debugging – even remotely debug an app running on a Mac (Matt saw it live!)
· Multiple languages are supported: JavaScript, Ruby, Python, C#, VB .NET, etc

Check this @ http://www.microsoft.com/silverlight/default01.aspx
Download ... It’s free: http://silverlight.live.com/

Cheers - Dipesh

Thursday, April 26, 2007

Ent Libs - How to use Logging block?

Did you know how easy it was to use Ent Libs. In this post i am showing you how to use Logging block. You need to install Ent Libs 2.0 if you are using .net 2.0. Ent Libs 3.0 is out for .net 3.0. You then open Enterprise library configuration tool to create a new app.config or specify your application config file to be modified. It is here you will specify how you want to log.... File, Event, Database or other different listeners provided. This tool is highly configurable so feel free to explore a little. This post will show you how to log your errors/messages to a text file. Once you are configured through this config file you just have to pretty much write 2 lines of code. Easy..is it? Super Easy! :)


C# Code -
private static FlatFileTraceListener nFile;

private static void WriteLog(string sComments)
{
Console.WriteLine(sComments);
//Logger.Write(sComments);
if (nFile != null)
{
nFile.Write(DateTime.Now.ToString() + ": ");
nFile.WriteLine(sComments);
nFile.Flush();
}
}
Your Config file should be with entries of Ent Libs and trace listeners based on the settings we did above using the Ent Libs GUI tool.
Cheers - Dipesh

Validate XML against your schema XSD

Hi - This post is basically to demenstrate how you can validate your XML input against a specified XML schema. The sample below uses new .net 2.o objects rather than obsolete .net 1.1 objects. I have commented few obsolete objects to highlight the differences.

using System;
using System.Xml;
using System.Xml.Schema;
using System.IO;

namespace ConsoleApplication3
{
///
/// Summary description for Class1.
///


class Class1
{
///
/// The main entry point for the application.
///


System.Boolean m_success;
[STAThread]
static void Main(string[] args)
{

//XmlValidatingReader reader = null; //obsolete in .net 2
XmlReader reader1 = null;

//XmlSchemaCollection myschema = new XmlSchemaCollection(); //obsolete in .net 2
XmlSchemaSet myschema1 = new XmlSchemaSet();
ValidationEventHandler eventHandler = new ValidationEventHandler(Class1.ShowCompileErrors);

try
{
//Create the XML fragment to be parsed.

// String xmlFrag = "YOUR XML string here" ;

//Create the XmlParserContext.
XmlParserContext context = new XmlParserContext(null, null, "", XmlSpace.None);

//Implement the reader.
//reader = new XmlValidatingReader(xmlFrag, XmlNodeType.Element, context); //obsolete in .net 2.0
XmlReaderSettings rs = new XmlReaderSettings();

rs.ValidationType = ValidationType.Schema;
myschema1.Add("http://www.newmarketinc.com", Server.Mappath("DirectBook.xsd"));
rs.Schemas.Add(myschema1);
StringReader srXml = new StringReader(xmlFrag);
reader1 = XmlReader.Create(srXml, rs, context);

//Add the schema.
//myschema.Add("http://www.newmarketinc.com", "D:\\Documents and Settings\\Administrator\\Desktop\\MI\\DirectBook.xsd");

//Set the schema type and add the schema to the reader.
//reader.ValidationType = ValidationType.Schema;
//reader.Schemas.Add(myschema);
while (reader1.Read())
{ //empty loop;
}
Console.WriteLine("Completed validating xmlfragment");
}
catch (XmlException XmlExp)
{
Console.WriteLine(XmlExp.Message);
}
catch (XmlSchemaException XmlSchExp)
{
Console.WriteLine(XmlSchExp.Message);
}
catch (Exception GenExp)
{
Console.WriteLine(GenExp.Message);
}
finally
{
Console.Read();
}
}
public static void ShowCompileErrors(object sender, ValidationEventArgs args)
{
Console.WriteLine("Validation Error: {0}", args.Message);
}
}
}

References -
.net 1.1 - http://www.codeproject.com/cs/webservices/XmlSchemaValidator.asp,
http://support.microsoft.com/kb/318504

.net 2.0 - http://aspalliance.com/941

Cheers - Dj

XSD Element

The any element enables us to extend the XML document with elements not specified by the schema!

The any element enables us to extend the XML document with elements not specified by the schema.
The following example is a fragment from an XML schema called "family.xsd". It shows a declaration for the "person" element. By using the element we can extend (after lastname) the content of "person" with any element:

[person - last name, firstname, any]
any can contain any additonal information (any other element from other schema as well)
So you can define another child.xsd and add it in your XML
Your XML can contain something like -
[person - lastname, firstname, [children - childname] ]
Its little difficult to format the XML output in this blog so please reference this link - http://www.w3schools.com/schema/schema_complex_any.asp

BTW, w3schools is the best site for all your questions regarding XML schema.
Cheers - Dj

Monday, April 23, 2007

नमस्ते !
This small piece of code is very helpful when you want to do repetative tasks of Fetching an XML and forming a dataset out of it.

public DataSet FetchDataSet(string fetchXml)
{
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;
string strResult = service.Fetch(fetchXml);

DataSet ds = new DataSet();
StringReader reader = new StringReader(fetchXml);
ds.ReadXml(reader);
return ds;
}

Cheers - Dipesh

Tuesday, April 10, 2007

Latest Release: Enterprise Library 3.0 – April 2007 (for .NET Framework 2.0 and 3.0)

Here it is...
http://msdn2.microsoft.com/en-us/library/aa480453.aspx

Download Ent Libs 3.0 for .net framework 2.0 and 3.0

Cheers - Dipesh
Long time, tied up with some work... but i am going to keep this rolling.
Let's take a light topic... do you know how to Read and write web App.config files?
Here it is...
Read Config -
static void ReadConfig()
{
foreach(string key in ConfigurationManager.AppSettings)
{ string value = ConfigurationManager.AppSettings[key];
Console.WriteLine("Key: {0}, Value: {1}", key, value);
}
}

Write Config -
static void WriteConfig() {
// Open App.Config of executable
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

// Add an Application Setting.
config.AppSettings.Settings.Add("ModifiedDate", DateTime.Now.ToLongTimeString() + " ");
// Save the changes in App.config file.
config.Save(ConfigurationSaveMode.Modified);
// Force a reload of a changed section.
ConfigurationManager.RefreshSection("appSettings");
}
}}


Output:
Key: Settings1, Value: Value1
Key: Modified Date, Value: 12:00:00


Ok, did you figure that the app.config does not stick values for the keys that you added or for the keys that you modified. Check the app.exe.config in the debug or release version. You should find it stick there. I foudn it little wierd but not sure when in debug mode i could not find app.config modified but had app.exe.config modified. If anyone you have had the same experience and seems that i might have missed something then please let me know.

Well, before i end you have another option as Settings file that can be used to get/set settings at user/application level for your application as well.

Thanks - Dipesh

Thursday, March 22, 2007

How to get the machine name, user name, OS etc. in .net?

Simple one., but worth mentioning it... How to get the machine name, user name, OS etc. in .net?

Use of System.Environment!

System.Environment:

This Class is used to get the information about current logged in user in the Windows. that is this class will get all the information about the current user in the windows. it is also used to get the info about the Machine and its Harddrive and other information.

Frequently used Methods and Properties
System.Environment.UserName - To get the Current logged in user name and his ID.
System.Environment.Version - To get the Current Version of CLR
System.Environment.UserDomainName - To get the Domain Naem associated with the current user.
System.Environment.SystemDirectory - Fully Qualified Path of SYS. Directory
System.Environment.OSVersion - To get the OS version
System.Environment.MachineName - To get the Machine name
System.Environment.GetLogicalDrives() - To get the Logical Drives of the Computer
System.Environment.Exit - To Exit the Current Process
There are lot of properties and functions available apart from this, please browse through in .net.

Cheers - Dipesh