.NET King technical and support webloghttp://www.dotnetking.com/TechnicalArchive.aspx.NET King RSS FeedEnglishTuesday, March 09, 2010Sat, 17 Mar 2007 19:43:06 GMT.NET King RSS Service1972Visual Studio 2008, ASP .NET and Crystal Report - [Technical] It is interesting that the article "Crystal Reports in ASP .NET Web Applications" is the most viewed page on my website. Although it is not the latest version of Crystal Reports and Visual Studio, the code is still valid with Visual Studio 2008. Now with YouTube and all new video technologies I am thinking of making a video about using Crystal Reports in ASP .NET 3.5 and new components available in the new product.
It is coming soon, Stay tuned.
Cheers
Alireza
 

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=367Feb 12, 2010
How to change the size of Quick Launch menu in SharePoint - [Technical]Assuming that you are using the default master page, the size of the quick launch menu is fixed 150X400 pixels. If the content is anything more than this size it automatically adds scroll bars. To change size of this area open the default.master in SharePoint designer. Go to the code view and find SharePoint:SPRememberScroll tag. The style attribute has the size of the quick launch area.

Here is the default value

Style="overflow: auto;height: 400px;width: 150px; "

 

Simply change it to anything you like:

Style="overflow: auto;height: 400px;width: 250px; "

Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=366Feb 08, 2010
First Look at SharePoint 2010 – Presented by Savash Alic - [Technical]here.
Cheers
Alireza]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=360Oct 21, 2009
.NET Framework is 7 years old today - [Technical] In 2002 Version 1.0 was released with Visual Studio .NET
In 2003 .NET Framework 1.1 was released embeded in Windows 2003 Server. (Operating system relies on .NET Framework)
In 2005.NET Framework 2.0 was releases with Visual Studio 2005 and SQL Server 2005. (Relational Database engine relies on .NET Framework)
In 2006 .NET Framework 3.0 was released enbeded in Windows Vista and Windows Server 2008. (Client desktop relied on .NET Framework)
In 2007 Microsoft releases .NET Framework 3.5 with Visual Studio 2008 and Windows 7.
Happy Birthday .NET. You are growing fast!
Cheers
Alireza ]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=358Feb 13, 2009
SQL Server 2008, Ideal for developers - [Technical]this article some time back and I really enjoyed it. It reveals the sexiest features of SQL Server 2008 for techies and especially developers. Can anybody show me an articled that explains the value of SQL Server 2008 for executies? In better word I need something that can explain the value of this amazing product for decision makers who are not technical.
Cheers
Alireza ]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=357Feb 11, 2009
Is SharePoint branding important? - [Technical] “Branding!? Is branding giving you any functionality? So why shall I waste my time on branding?”
A trainer will possibly say:
“Branding and UI customization makes the product look different from the original look different and makes the learning costly”
Here is my challenge: “Is SharePoint a product?” I can say MOSS is a product but most of the developers look at WSS just as a platform. When a developer builds a product on SharePoint platform, then it is not SharePoint. Now branding gives context to data and makes turns it into information. The branding that brings the user to the right context is critical to deliver the information in the right way and result in right reaction from information workers. In better word just because we are not graphic desighers doesn’t mean that we can take their work for granted!!!!
Cheers
Alireza ]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=356Feb 10, 2009
SharePoint Restore Error - [Technical]

Your backup is from a different version of Windows SharePoint Services and cannot be restored to a server running the current version. The backup file should be restored to a server with version '12.0.0.6335' or later.

It sounds like an odd error but lets face it. STSADM backups are not service-pack independent. It just reminds me of restoring SQL Server system databases. Remember that you need to have identical service packs on source and destination of the backup. Otherwise your restore shows you this.

Check this little post by Aaron Saikovski to get your exact solution.

Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=355Jan 25, 2009
From a Product called SharePoint to Basic Concepts - [Technical] For years I was blaming Microsoft Official Curriculum for different courses for one very simple reason. The courses are technology oriented. In better word you go through all the .NET courses and exams and earn your MCSD credential but still you don't know design patterns. You become an MCDBA without having a good grasp of Normalization and RDBMS. Now guess what? Somebody is an MCDBA who knows SQL Server inside out, yet sucks at delivering a reasonable database model for a solution. This becomes even worse when it comes to SharePoint content management. I have worked with lots of clients that start with SharePoint implementation and in no time end up with a file garbage dump rather than a content management solution. It is obvious, because we never gave them the content management basics. Imagine building a house by just trial and error, without an architect in place.

 Now take a look at this course content for a change:
Architecting Web Content Management Solutions with Microsoft Office SharePoint Server 2007 

Hey, it seems like Microsoft response to this need. Or look at this one:

Architecting and Planning the Search Capability in Microsoft® Office SharePoint® Server 2007

Actually this is not a new course approach, I have delivered database modeling from Microsoft Official Curriculum 6 years ago. I only believe these courses are not marketed well simply because most of the clients see Microsoft as pure technology provider. SharePoint is a new product with new concepts around it. Consider basics before you get into the technology!

 Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=354Jan 25, 2009
Creating SharePoint Permission levels programmatically (C#) - [Technical]Imagine you are asked to create a custom permission level for all the sites in a MOSS/WSS site collection. I mean one of these things that you see in the below screen capture! Sounds silly, because you can easily click on the "Add a Permission Level" and finish the job. Now imagine that sites do not inherit the permission levels and you have only 200 sites in the site collection. Now it sounds like a nightmare.

Now here are the magic C# words to break the spell! Your code should automate this step.

Here are some important considerations.
1. You have 200 sites and there is no guarantee that all sites are following the same role inheritance setting. In better word some sites may inherit the roles and some don't. It is obvious that you cannot and you don't need to create this role in the sites that they inherit.
2. You have to create this role in the root website of the site collection.

Take a look at this code.

    SPWeb myWeb = mySite.AllWebs[i];
    if (myWeb.HasUniqueRoleDefinitions || myWeb.IsRootWeb)
    {
 
        try
        {
            MessageBox.Show(myWeb.Title);
            myWeb.AllowUnsafeUpdates = true;
            SPRoleDefinition rd = new SPRoleDefinition();
            rd.BasePermissions = SPBasePermissions.ManageLists |

            SPBasePermissions
.CancelCheckout |

SPBasePermissions.AddListItems
| SPBasePermissions.EditListItems |

SPBasePermissions.DeleteListItems;
      rd.Name = "Custom role 01";
      myWeb.RoleDefinitions.Add(rd);
      myWeb.Update();
  }
  catch (Exception ex)
  {
            MessageBox.Show(ex.Message, myWeb.Title);
  }
}

 Don't forget to import:
using Microsoft.SharePoint;

Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=353Jan 24, 2009
How to read SharePoint list items attachments programmatically? - [Technical]See the following code snippet:

  SPSite mySite = new SPSite("http://sharepoinsiteaddress");
  SPWeb myweb = mySite.OpenWeb();
  SPList myList = myweb.Lists["Announcements"];
  SPListItem myListItem = myList.GetItemById(1);
  foreach (String attachmentname in myListItem.Attachments)
  {
   String attachmentAbsoluteURL =
   myListItem.Attachments.UrlPrefix // gets the containing directory URL
   + attachmentname;

   // To get the SPSile reference to the attachment just use this code
   SPFile attachmentFile = myweb.GetFile(attachmentAbsoluteURL);

 

   // To read the file content simply use this code
   Stream stream = attachmentFile.OpenBinaryStream();
   StreamReader reader = new StreamReader(stream);
   String fileContent = reader.ReadToEnd();

   // assuming that file is a text attachment
   MessageBox.Show(fileContent);
  }

I think the code is self descriptive. Just some points to remember:

  • Attachments collection of SPListItem object is not SPFile. It is string that only represents file name.
  • Most of the time just a hyperlink to the attachment serves the purpose for the web UI design.
  • I used a windows application to present this code, you may implement it in any project.
  • Don't forget the required namespaces.
    • using System.IO;

    • using Microsoft.SharePoint;

Enjoy!
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=352Jan 07, 2009
CamStudio or Camtasia - [Technical] For a long time I was using Camtasia Studio for screen capture and recording online presentations. I always liked this software becasue it doesn't interfere with the other applications on the dev server that is usually heavily loaded with lots of different software solutions and services and it doesn't slow down the server as well. It provides a very strong sound and movie editing studio but you need to pay 299 USD for the license.

 My new choice is CamStudio. It doesn't give you a fancy movie editing studio, but it happily works on Windows 2003 server loaded with MOSS 2007 and BizTalk 2006. It doesn't slow down any process and it is FREEEEEE!!! Ok, for the editing studio go for Microsoft Movie Maker and you are all set.

Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=351Jan 04, 2009
Get rid of HTML and XML tags - [Technical] When you work with word xml files and locate a field in the schema what you read usually contains XML decorating tags that most probably you don’t need them in your code. How can we get rid of them?
It is pretty simple. Brush up your .NET knowledge and remember we have a class called Regex which is a short name for Regular Expression object. Using Regex you can simply define a pattern for XML or HTML tags. This pattern will be something like this: "<[^>]*>".
The very same Regex class has Replace function that works just like Replace in String class. Having them all together in C# you will have a code like this:
 

  public string RemoveTags(String originalMessage)

  {

      Regex rgx = new Regex("<[^>]*>");

      return rgx.Replace(originalMessage, "");

  }

This function simply gets an HTML/XML String and returns pure text. Don’t forget to add
using System.Text.RegularExpressions;
to your file header.
Enjoy
Alireza
 

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=347May 30, 2008
How to delete an SQL Server 2005 database (Somehow SharePoint)? - [Technical]It looks like a silly question but I’d like to mention some cool stuff about it. When you drop the database it should delete the database file and the log file accordingly. At least this is what we expect. But what if the database is off-line? Haha, give it a try. Your drop script will delete the data but the data and log files stay there. Now if you want to create another database with the same name you see this:

 

But how this is related to SharePoint?
Remember that when you create MOSS or WSS Site collections it gives you the chance to pick a database name? Now remember when you uninstall SharePoint it doesn’t delete the databases?
Ok, here is what happens. You uninstall MOSS or delete Site Collection. Then you may think that, I may use these data in the future or for any reason database is in use and you cannot delete it so you take it off-line and then you delete and forget it while the files are still there. When you want to create another site collection or a new installation the existing files will not let you create the new database.
But why do you want to take the database off-line?
Taking the database off-line means that we don’t want anybody connect to the database anymore but we are polite enough to let the current users to the database finish their work. It doesn’t kill the existing connections and it takes some time for all the live users to finish their work and disconnect and in the meanwhile no new connection is made to the database. Usually when junior database administrators want to delete a database that there is live connection to that and they come up to related errors they try to take the database off-line, which is a good move, but do you really want to keep the current users when you want to delete what ever the data that they enter? So to drop a database simply go to SQL Server 2005 management studio and Management -> Activity Monitor. If you just double click on the activity monitor you can see a list of all the databases and existing connections to them. Simply right click on the database and kill the connection. Then you will be good to delete the database.
Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=345May 02, 2008
Busy days with project - [Technical]
The bad news is that I am very busy with the project deployment with Loblaw so I can hardly find time to blog something considering that I come home sometimes after 10:00 or 11:00pm. The good news is that I am learning lots of cool stuff in this project that I can share with you in the coming days. So stay tuned with my latest updates.
Cheers
Alireza
]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=344May 01, 2008
There are no primary or candidate keys in the referenced table - [Technical]Msg 1776, Level 16, State 0, Line 1
There are no primary or candidate keys in the referenced table 'dbo.Products' that match the referencing column list in the foreign key 'FK_Sales_Products'.
Msg 1750, Level 16, State 0, Line 1

Have you seen this error before? Hah, you just noticed it? Cool! Let's see where the error is coming from.

I created two tables as Products and Sales. There is a foreign key that forces the sales table to use only valid values for ProductAbbreviation in Products table. To create a foreign key constraint I can simply run this script:

ALTER TABLE [dbo].[Sales]  WITH CHECK ADD  CONSTRAINT [FK_Sales_Products] FOREIGN KEY([ProductAbbreviation])

REFERENCES [dbo].[Products] ([Abbreviation])

GO

ALTER TABLE [dbo].[Sales] CHECK CONSTRAINT [FK_Sales_Products]

Here is the point. This foreign key refers to a field called Abbreviation. There is just one simple rule on this game. You cannot make a reference to a field that is not unique. In better word your foreign key can only refer to a field that has a unique constraint like Primary Key or Unique Index. Now read the error again and you can simply understand what is going on.

To have this script work you need to create a unique index on Abbreviation field in Products table or make it a primary key that guarantees uniqueness. So simply go to index management and create a unique index on that field or run this script to create it like old fashioned developers:

CREATE UNIQUE NONCLUSTERED INDEX unq_abbr ON dbo. Products

(Abbreviation)

Then you can create your foreign key happily ever after.
Enjoy
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=343Apr 25, 2008
Active task shouldn't be deleted in SharePoint workflow - [Technical]One of the typical problems in workflow development is task deletion. Usually users that interact with the task, have contribute permission to the task which means they can simply delete the tasks that are created as a part of workflow processing. Deleting a task can mess up the workflow and we may need to handle it as a part of the workflow. But how can we stop the users from deleting tasks? The solution is very simple. Item event handlers in MOSS/WSS 2007 can easily take care of this case. Item event handlers are events that are registered to a list and mapped to a dll that is already deployed to GAC. When an event (insert, delete and update) happens the event handler fires and execute the code that can do something in response or may even cancel the event trigger progression. This is exactly our scenario. We need to build an event handler that when a user tries to delete a task, it checks the task status. If the status is not "Completed" then in cancels the deletion and displays an error message. To implement this simply create a class library project in Visual Studio .NET and make a reference to Windows SharePoint Services Library. Then add the following code. Inline code description is included.

using System;
using
System.Collections.Generic;
using
System.Text;
using
Microsoft.SharePoint;

namespace StopActiveTaskDelete
{
    //Inhertit your class from SPItemEventReceiver
    public class CActiveTasksDelete: SPItemEventReceiver
    {
        // Override the ItemDeleting function. You will find also ItemDeleted
        // function that fires when the item is deleted. For your scenario we
        // need ItemDeleting to stop the delete process before it is complete.
        public override void ItemDeleting(SPItemEventProperties properties)
        {
            //Built in call to the initial definition
            base.ItemDeleting(properties);
            // Get reference to the current item being deleted
            SPListItem myItem = properties.ListItem;
            // Read the status field of the item being deleted
            String taskStatus = myItem["Status"].ToString();
           

            // Is the task status is Complete it is not active task any more
            // Otherwise we cancel the deletion
            if (taskStatus != "Completed")
            {
                // This is the message that we'd like to show to the user
                // if he/she tries to delete an active task
                properties.ErrorMessage = "This task is still in progress and cannot be deleted";
                // This line actually cancels the delete
                properties.Cancel = true;
            }
        }
    }

}

Sign the assembly with a strong name key and deploy it to the global assembly cache. Now all you need to do is to introduce the this assembly to a task list in SharePoint. There are different ways of doing it, but the simplest way is using a simple consol application to do so.

Your script should look like this:

using System;
using
System.Collections.Generic;
using
System.Text;
using
Microsoft.SharePoint; 

namespace RegsiterEventReceiver
{
    class Program
    {
        static void Main(string[] args)
        {
            // Get reference to the the site that containd your task list
            SPSite mySite = new SPSite("http://sharepointSiteURL");
            SPWeb myWeb = mySite.OpenWeb();
            // Get the reference to your task list
            SPList myList = myWeb.Lists["Tasks"];
            myList.EventReceivers.Add(SPEventReceiverType.ItemDeleting,
                "StopActiveTaskDelete, Version=1.0.0.0, Culture=neutral" +
                //Replace this key with your own assembly publick key token
                ", PublicKeyToken=8a1a592e4ca85c4c",
                "StopActiveTaskDelete.CActiveTasksDelete");
            // Don't forget to update the list
            myList.Update();
            // Make sure you add this life to feel good after your
            // Solution is deployed successfully
            Console.WriteLine("Haha, done!");

        }
    }
}

Now go to the SharePoint Site and try to delete an incomplete task. You will get this error page.

And this code will protect active tasks from deletion happily ever after.
Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=341Apr 18, 2008
Setting Item Level Security programmatically for SharePoint list items - [Technical] This is not a unique post. You may find this post in many weblogs and websites, but I am putting this code here for my own reference. In this code I break the security inheritance for a list item and provide contribute permission for a group that has been already created in SharePoint site.

 

            SPListItem myItem = properties.ListItem;
//This line detaches the item security from the list
            myItem.BreakRoleInheritance(false);
            myItem.Update();
            SPWeb myWeb = properties.OpenWeb();
// Creates an object of type SPMember to represent a group
            SPMember member = myWeb.SiteGroups["TestGroup"];
// We can simply cast a SPMember object into a SPPrincipal variable
            SPPrincipal principal = (SPPrincipal)member;
// A role definition is required to represent a permission level in SharePoint site
            SPRoleDefinition roledefinition =
                myWeb.RoleDefinitions.GetByType(SPRoleType.Contributor );
            SPRoleAssignment myRoleAssignment = new SPRoleAssignment(principal);
            myRoleAssignment.RoleDefinitionBindings.Add(roledefinition);
            myItem.RoleAssignments.Add(myRoleAssignment);
            myItem.Update();

 Enjoy the code.
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=340Apr 15, 2008
SharePoint Conference 2008 Dubai follow up - [Technical]I finally got enough e-mails to start bloging my presentations in the conference. Here is the answer to some of the requests that I received after conference.

Enjoy
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=339Apr 14, 2008
SharePoint Conference 2008 in Dubai - [Technical] After a long and very busy time working on projects and books I am back online with some cool stuff. I will be speaker in SharePoint Conference 2008 Dubai. I have picked up 3 subjects for my presentations that you can find the complete conference agenda here.

  • Using Excel Services to build BI solutions: I personally believe this title is not well articulated. I guess Excel Services is something that everybody should explore it personally so I am not going to completely cover features and capabilities of excel services. I will do my best to deliver the presentation so that the audience can repeat the experience themselves. This lecture will include:
    • Excel services from scratch (how to have it running from a clean installation)
    • Excel services architectural design (Data sources, trusted locations, security structure)
    • Using Excel Services to bring data from SQL Server to MOSS interface with data graphs
    • Using Excel Services to bring Analysis Services Cube data and graphs to MOSS Server
    • Excel Services and BI components (Introducing MOSS out of box and how excel services interacts with MOSS BI lists and BI Dashboard)
    • Q&A
  • Building applications using MOSS 2007 web services: Don't get me wrong, this presentation is not for developers. I am targeting IT-Professionals and I am trying to keep it at 200 level. Here is my presentation outlines:
    • What is XML Web Service?
    • How can we call XML Web Services without code (I am targeting InfoPath)?
    • Introducing built-in XML Web Services in MOSS 2007.
    • Connecting XML Web Services and MOSS 2007 document libraries using InfoPath 2007 glue (Hay InfoPath 2007 glue is NOT a product name - lol).
    • How to deploy these XML Web Service containing InfoPath forms to the MOSS 2007 forms server
    • How can developers build custom Web Services to expose more MOSS features
  • Office Automation using Microsoft Word 2007 and MOSS 2007: This is basically a case study around using Microsoft Word 2007 XML file that is also called WordML. This presentation is basically an open discussion around using WordML files instead of normal word files. I am just trying to explain how easy it is to utilize your basic XML Programming skills to manipulate sections of the WordML files.

I really appreciate if you spare a minute or two and give me your feedback.
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=338Apr 05, 2008
American or Canadian C# Code? - [Technical] The worst thing that I can imagine is that the compiled code works properly on your development/staging environment but fails to work on production. The nightmare starts when you just remember that you don't have debugger on production. Here is what happened to me yesterday. I developed a web service for the Time-Off time calculation. The code was excluding Ontario statuary holidays. This service apparently without any external dependency was working beautifully on my development laptop, but failing with some strange error on the server.

Take a look at this code:
DateTime holiday = DateTime.Parse("28/02/2008");

Sounds ok and works well on my Canadian computer (hey, it is made in China but Windows regional options is set to English(Canada)). But the very same line of code fails to run on an American machine. Simply because the American version of this code should be like this:
DateTime holiday = DateTime.Parse("02/28/2008");

That's just the date format but what can you do in a compiled code for this? Aha, .NET Framework is the answer. If you read the time variable from a Calendar or a DateTimePicker then the control is smart enough to do that, but if you are reading a preformatted string or you are hard-coding the date in your application then this issue come up. Here is the right way of solving this problem:

using System;
using System.Globalization;

namespace DotNetKing
{
    class Program
    {
        static void Main(string[] args)
        {
            CultureInfo culture = new CultureInfo("en-CA");
            DateTime holiday = DateTime.Parse("28/02/2008", culture);
            Console.Write(holiday.ToString());
        }
    }
}

This way you not only hardcode the date but also hardcode the date culture, so your code behaves Canadian even on an American server!
Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=337Feb 28, 2008
Forms Server on the MOSS Farms - Silly error - [Technical]Take a look at this error first:

An error occurred accessing a data source.
An entry has been added to the Windows event log of the server.
Log ID:5566

 

Does it look familiar? No? How about this one?

I assume that you love it because without these errors we could never have a job as consultant. I got this error when I deployed an InfoPath 2007 form to MOSS 2007 forms server. There was nothing wrong with the form but it was getting the user information from MOSS profile to have some part of the form pre-populated. First of all when I checked the application log on the front end server I found nothing. Considering the farm installation I could find the error on the server box that was hosting the SharePoint Central Administration service. Here is the error in the application log:

A runtime exception was detected. Details follow.
Message: Access Denied! Only site admin can access Data Source object from user profile DB.

Techinal Details:
System.UnauthorizedAccessException: Access Denied! Only site admin can access Data Source object from user profile DB.
at Microsoft.Office.Server.UserProfiles.SRPSite.AdminCheck(String message)
at Microsoft.Office.Server.UserProfiles.DataSource._LoadDataSourceDef(IDataRecord rec)
at Microsoft.Office.Server.UserProfiles.DataSource._LoadDataSourceDef(String strDSName)
at Microsoft.Office.Server.UserProfiles.DataSource..ctor(SRPSite site, Boolean fAllowEveryoneRead)
at Microsoft.Office.Server.UserProfiles.DataSource..ctor(SRPSite site)
at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager.GetDataSource()
at Microsoft.Office.Server.UserProfiles.BDCConnector.RefreshConfiguration(String sspName)

For more information, see Help and Support Center at

It seems that the forms server is trying to access to Profile Services on MOSS and it is complaining that Only Site Admin can do that. Here was the tricky part. On the top of the page I could see the spadmin login account. This account was site admin for MOSS, SharePoint Central administration and also Shared Services Provider site. So what else is missing?

The answer is here:
Go to SharePoint Central administration --> Application Management --> Authentication Providers. Then select the default zone. Make sure the right Web Application is selected on the top of the page. Clear the checkbox for the anonymous access. And now you can run your form with the forms server happily ever after.

Important point:
When you are using Forms Server with MOSS the site security is not applied to the underlying services. It means even if your MOSS website requires authentication, if Provider is anonymous enabled forms services uses anonymous login for the external access, because it looks at the provider, not the site that is hosting the form. It took me a long time to find it out because I had the impression that Forms Server impersonates the user login information and when I see the user ID on the top of my SharePoint page, this is not anonymous call. I was wrong.

With special thanks to Infusion SharePoint Technical team that gave me wonderful guides to resolve this issue.

 Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=336Feb 27, 2008
How I fell in love with Microsoft .NET - [Technical] On Feb 14, 2002 I was living in Dubai. February 14 is a very special day and every body expects e-mails and gifts from lovers. On that day early in the morning when I opened my mailbox and I was expecting lots of e-mails with pink hearts in it, I found just one e-mail that announced the final release of the .NET Framework 1.0. My god, is Microsoft .NET the only one who remembers me on Valentines day? I was working with Beta release of Visual Studio .NET but from that day I fell in love with .NET. Today is the 6th anniversary of Microsoft .NET first release. So happy birthday .NET and Happy birthday Visual Studio.

Remember that first version of .NET was released on February 13th, 2002.

I Wish all .NET Developers a
wonderful birthday
]]>http://www.dotnetking.com/TechnicalComments.aspx?LogID=333Feb 13, 2008WebPart audience targeting is not appearing - [Technical]  

 I had a funny problem today. On one of the client sites we were trying to enable audience targeting on a development server box and simply I couldn't find the Target Audiences box. Simply it was not there. Guess what the problem was!

Shared Service Provider was not created on the server.

Morale:

  1. Please do the setup steps completely and review the Setup tasks
  2. If the problem is very weird, look for some weird cause
  3. When you find the cause share it with the others

It is interesting that I couldn't find any cause for this problem by searching the internet.

Cheers
Alireza

  ]]>http://www.dotnetking.com/TechnicalComments.aspx?LogID=331Feb 08, 200864 Bit IFilter for PDF files - [Technical]  Have you ever used iFilters for PDF in MOSS? It's beautiful. You may simply download it from adobe website and install it on the MOSS Server and enjoy the enterprise content search for the PDF content. Such a sweet component becomes a pain once you'd like to upgrade to 64 bit platform, simply because  adobe iFilter it doesn't have 64 bit support.
 Last week I found Foxit PDF iFilter. It is not a free product, but $1184.93 doesn't look like an issue for a huge enterprise with 64 bit implementation of MOSS. I haven't tried it yet myself, so if you have used it before send me your feedback.

Cheers
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=329283e1bdf-4e66-497b-a480-647a3a71beedJan 14, 2008
How to setup MOSS development environment - [Technical] After I completed the MOSS development training in Barrie there was a request to a checklist to setup a MOSS development environment. Here are the steps:

  1. Configure a virtual PC machine with at lease 1GB memory allocated
  2. Install windows 2003 Server standard edition on the virtual PC (You may also go for enterprise edition, but because of some unnecessary services on enterprise edition it will perform slower than enterprise edition while it doesn't give you anything extra for MOSS development)
  3. Go to windows Control panel and Add/remove windows component:
    1. Add ASP .NET (as a result of this selection any necessary IIS component will be installed)
    2. Add local SMTP server
    3. Make sure FrontPage server extension is not selected
    4. Remove "Internet Explorer Enhanced Security Configuration". It is not a MUST, but for development environment that we need absolute freedom, it is quite annoying.
  4. Install the latest service pack available for windows 2003. (it is still too early to go for windows component update)
  5. Install Visual Studio .NET 2005 (Professional or VSTS) and make sure you Install C# components (VB .NET is not enough) and make sure you UNCHECK the SQL Server express edition that comes as embedded component in Visual Studio .NET.
  6. Install Visual Studio .NET Service pack 1.0
  7. Install .NET Framework 3.0
  8. Install MOSS 2007 as stand alone installation with all default settings
  9. Install "Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)"
  10. Install MOSS 2007 SDK
  11. Install Windows SharePoint Services 3.0 Tools: Visual Studio 2005 Extensions
  12. Install Microsoft Office 2007 (InfoPath, Outlook, Word, PowerPoint, Access and Excel are mandatory). You may uncheck Microsoft Publisher, Microsoft Groove and One Note.
  13. Install Microsoft SharePoint designer 2007
  14. Install VSTO
  15. Connect the Virtual PC to Internet and run Windows Update
  16. Read this and install all the components mentioned there.

Have fun
Alireza

]]>
http://www.dotnetking.com/TechnicalComments.aspx?LogID=3220c12f19b-c3e5-48ba-8621-c2a2491166efDec 01, 2007