Saturday, October 24, 2009

SQL: comparision of SQL Server Databases 2005

hi,

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 : http://www.microsoft.com/Sqlserver/2005/en/us/compare-features.aspx

Hope it helps

Regards
4Z ~ Fauzi

Wednesday, October 21, 2009

MOSS: Email Notifications and Alerts problem in Tasks

Hi...

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

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

Resource: http://social.msdn.microsoft.com/Forums/en-US/sharepointgeneral/thread/398f0a1d-621b-4813-a64a-4065d35c0842

Hotfixes:
http://support.microsoft.com/kb/948945

http://support.microsoft.com/kb/948947

Hope it helps...

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

Regards
Fauzi


Wednesday, October 14, 2009

MOSS: How to disable checkin option in document Library

Hey...

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 .

Reference

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.


Code:

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

Hi...

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#.

Code:

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\">";

objTableRow_Welcome.Cells.Add(objTableCell_welcome1);

objTable.Rows.Add(objTableRow_Welcome);

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

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

MailAddress recipient = new MailAddress(" FAUZI @ INDIA.com", "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 =

AlternateView.CreateAlternateViewFromString(

plainTextBody, null, MediaTypeNames.Text.Plain);

m.AlternateViews.Add(plainTextView);

//Rendering Text from Created HTML TABLE in runtime

StringBuilder htmlBody = new StringBuilder();

StringWriter objStringWriter = new StringWriter(htmlBody);

HtmlTextWriter objHtmlTextWriter = new HtmlTextWriter(objStringWriter);

objTable.RenderControl(objHtmlTextWriter);

//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";

htmlView.LinkedResources.Add(sampleImage);

//Adding the created Alternate view

m.AlternateViews.Add(htmlView);

// Finally, configure smtp or alternatively use the

// system.net mailSettings

smtp.Send(m);


Hope it helps...

Please remember to give appropriate path of the image file.


Best Regards

Fauzi