Saturday, October 24, 2009

SQL: comparision of SQL Server Databases 2005


Here is the comparisons of different types of SQL Server 2005 databases in terms of Scalability and Performance, High Availability, Manageability, Security, Programmability, Integration and Interoperability,Business Intelligence

Resource :

Hope it helps

4Z ~ Fauzi

Wednesday, October 21, 2009

MOSS: Email Notifications and Alerts problem in Tasks


We had a mysterious problem in MOSS sharepoint portal in Tasks.
Following were the issues:
1. When ever a task is created; the alerts goes to people(some one in AD) for whom the tasks has not been assigned!
2. When ever edited also the same issue Plus the description will be striked & shown as such it has been changed.
3. When the tasks is deleted; the alert goes to the respective persons in the assigned to field and also to some other person in random!

Task Assigned to

Seems it is resolved in SP2 and there is also a Hotfix for the same issue.



Hope it helps...

This is My 100th post, Thanks for your continuous support :)


Wednesday, October 14, 2009

MOSS: How to disable checkin option in document Library


We had a requirement to disable checkin functionality in document library. The Idea was to reduce the steps to be done by the end user to upload documents easily. The bottom line was to make it simple for easy accessibility. Following are the steps to be done.

To enable/disable check-in and check-out on a SharePoint document library:

  1. Navigate to the SharePoint document library on which you want to enable check-in and check-out.
  2. On the Settings menu, click Document Library Settings .
  3. On the Customize page under General Settings , click Versioning settings .
  4. On the Document Library Versioning Settings page, select Yes /No for Require documents to be checked out before they can be edited? , and click OK .

To enable version control on a SharePoint document library:

  1. Navigate to the SharePoint document library on which you want to enable version control.
  2. On the Settings menu, click Document Library Settings .
  3. On the Customize page under General Settings , click Versioning settings .
  4. On the Document Library Versioning Settings page, select Create major versions if you only want to enable major versions on documents or select Create major and minor (draft) versions if you want both major and minor versions on documents, and click OK .


Hope It helps...

Fauzi 4z

Thursday, October 8, 2009

How to run a DTSX Programmatically through C#

Hey there...

For a data integration service, I create four DTSX packages. These were generic packages which needs to be executed one after the another. I tried using SQL Server Agent to schedule it as a JOB which has four steps to be executed sequentially. Unfortunately the package which is working fine is visual studio is not working when scheduled. There seems to be some permission issues(had the same issue few days before). As i had users waiting the see the output. I have to find an alternative solution soon. Here is the C# code to run the DTSX from a EXEC file.


Package pkg;

Application app;

DTSExecResult pkgResults;

Variables varStore;

pkgLocation = @"c:\documents and settings\Path\Filename.dtsx";

app = new Application();

pkg = app.LoadPackage(pkgLocation, null);

varStore = pkg.Variables;

varStore[YourVariable].Value = 123;

pkgResults = pkg.Execute();

Required NameSpace: The reference of Microsoft.SQLServer.ManagedDTS.dll has to be added and in code -

using Microsoft.SqlServer.Dts.Runtime;

Hope it helps :)

Monday, October 5, 2009

How to embed image in C# Email


I had an interesting requirement to generate daily reports based on the accumulated sales data. And this Email will be sent to the respective Managers. Thought it would give a better picture if the email have the appropriate Brand images embedded on necessary places in report.

Following code was very much useful to embed an image in a system generated e-mail through C#.


Table objTable = new Table();

objTable.BorderStyle = BorderStyle.Solid;

objTable.BorderWidth = 1;

objTable.GridLines = GridLines.Both;

objTable.CellPadding = 5;

objTable.CellSpacing = 1;

objTable.BorderColor = System.Drawing.ColorTranslator.FromHtml("#035681");

objTable.Style.Add("Font-family", "Verdana");

objTable.Style.Add("Font-size", "14");

//Welcome TABLE CODE:

TableRow objTableRow_Welcome = new TableRow();

TableCell objTableCell_welcome1 = new TableCell();

objTableCell_welcome1.ColumnSpan = 1;

// Embeddind Image ID which is created below.

objTableCell_welcome1.Text = "<img src=\"cid:SampleImage\">";



SmtpClient smtp = new SmtpClient("YOUR SMTP CLIENT");

MailAddress sender = new MailAddress(" FAUZI @", "Fauzi");

MailAddress recipient = new MailAddress(" FAUZI @", "Recipient");

MailMessage m = new MailMessage(sender, recipient);

m.Subject = "Embed image with C# mail";

// Define the plain text alternate view and add to message

string plainTextBody = "Best viewed in Email client(Outlook) that supports HTML messages";

AlternateView plainTextView =


plainTextBody, null, MediaTypeNames.Text.Plain);


//Rendering Text from Created HTML TABLE in runtime

StringBuilder htmlBody = new StringBuilder();

StringWriter objStringWriter = new StringWriter(htmlBody);

HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter);


//Creating an Alternate view

AlternateView htmlView = AlternateView.CreateAlternateViewFromString(htmlBody.ToString(), null, MediaTypeNames.Text.Html);

// Embedding Image here

LinkedResource sampleImage = new LinkedResource("logo.gif", MediaTypeNames.Image.Jpeg);

sampleImage.ContentId = "SampleImage";


//Adding the created Alternate view


// Finally, configure smtp or alternatively use the

// mailSettings


Hope it helps...

Please remember to give appropriate path of the image file.

Best Regards