Friday, November 30, 2007

MS CRM

CRM (Customer Relationship Management) is a business strategy focus on maximizing shareholder value through winning, growing and keeping the right customers.

To download MS CRM SDK, use below link
http://www.microsoft.com/downloads/details.aspx?FamilyID=9c178b68-3a06-4898-bc83-bd14b74308c5&displaylang=en

Good Luck!

Tuesday, November 20, 2007

Link to Free SharePoint 2007 Videos

Go to below link to watch some important SharePoint tasks.
http://office.microsoft.com/en-us/help/HA102199841033.aspx

Good Luck !

FileSystemWatcher Class in .Net

FileSystemWatcher class allows us to connect to the directories and watch for specific changes within them, such as creation of new files, addition of subdirectories and renaming of files or subdirectories. Using FileSystemWatcher it is possible to detect when certain files or directories are created, modified or deleted

We can initiate a FileSystemWatcher using any of below.


1. FileSystemWatcher Watcher = new FileSystemWatcher();
//Intializes a new instance of the FileSystemWatcher Class

2. FileSystemWatcher Watcher = new FileSystemWatcher("c:\\");
//Intializes a new instance with a Path property

3. FileSystemWatcher Watcher = new FileSystemWatcher("c:\\","*.txt");
//Intializes a new instance along with a Path and Filter properties

If we initiate it like in 1., we can set the Path and Filter proporties as given below

Watcher.Path = "c:\\";
Watcher.Filter = "*.txt";

Also we have to add followings too.


Watcher.EnableRaisingEvents = true;
Watcher.IncludeSubdirectories = false;
Watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size;

To access Created, Deleted, Renamed and Changed events, you have to define handlers that automatically call methods in your code when a change occurs. To create a handler, use the following code:


Watcher.Changed += new FileSystemHandler(myWatcher_Changed);
//Handler for Changed Event

Watcher.Created += new FileSystemHandler(myWatcher_Created);
//Handler for Created Event

Watcher.Deleted += new FileSystemHandler(myWatcher_Deleted);
//Handler for Deleted Event

Watcher.Renamed += new RenamedEventHandler(myWatcher_Renamed);
//Handler for Renamed Event

Then you can write codes for what you want to do when such event occured as given below

protected void watcher_Created(
object sender, System.IO.FileSystemEventArgs e)
{
//Codings for what you want to do
}

FileSystemWatcher class makes our work easy.

Good Luck !


Thursday, November 15, 2007

Creating a Custom Web Part for SharePoint 2007

To create a Custom WebPart you can follow following steps

* In this part you will create a WebPart which displays Current User.
* Create a class libraray using MS Visual Studio 2005
* Then following codes are added which use to show current user.
*

public class SimpleWebPart : WebPart
{
private string displayText = "Hello World!";

[WebBrowsable(true), Personalizable(true)]
public string DisplayText
{
get { return displayText; }
set { displayText = value; }
}

protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
writer.Write(displayText);
}
}

* Then you have to modify
AssemblyInfo.cs file by adding following coding

[assembly: AllowPartiallyTrustedCallers()]

*
Give your assembly a strong name. Just go into the Project
Properties and then go to the "Signing" tab to do this.
Alternatively, you can use the sn.exe command line tool to generate strong names
for you.


*Find the public key token for your assembly. An easy way to this is
to use a standard tool such as
Reflector. Once the DLL is compiled and built, drag and drop it
in Reflector. It should show you the public key token, along with the details
* Locate the SharePoint Web application in which you want to deploy this WebPart. You can do this via the IIS Manager under administrative tools.

*
Drop the DLL in the _app_bin directory in the virtual directory. By doing this, you effectively allow ASP.NET to access the DLL. You still need to take a few more steps for SharePoint to use that assembly.

*Then
under the same virtual directory, find Web.Config and add the following to the SafeControls section.
Assembly="MYWebPart,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=sfcvdsxbf7305ec3"
Namespace="MyWebPart"
TypeName="MySimpleWebPart" Safe="True" />

These values may differ from your values such as PublicKeyToken, Namespace,...

*
With Web.Config modified, you have to add the WebPart to the gallery. Through
your browser, go to the Web application whose virtual directory you have been
using. Once on that site, go to Site Actions -> Site Settings -> Modify
All Site Settings

*
Under that, click on "Web Parts" under Galleries

* Click on "New" in the toolbar, and find the MyWebPart.MySimpleWebPart

* Check the checkbox, go to the top, and click on "Populate Gallery". You should
see the MySimpleWebPart.webpart file ready to use in your site

* Then you can add this WebPart wherever you want.


Important Notes:

* Modify the web.config file using "Microsoft Visual Studio 2005 Tools for
Application", do not use WordPad.
* If You are working on a machine where SharePoint is not installed,
then you have to copy some .dll file from the machine where SharePoint
is installed.
Path for those .dll files is
"
Local_Drive\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\ISAPI"
* We have to add some additional Namespaces for our application.
* For the class file (Class1.cs) we have to add "using System.Web.UI.WebControls.WebParts;"
* For the Assemly.cs file we have to add "using System.Data" and "using System.Security;" namespaces