Wednesday, February 24, 2010

How to know that your machine/system is 64 bit capable?

Hi All,


If you want to know all about your PC machine hardware insights,then this post is for you.


I came across to this tool when i was in need of installing Sharepoint 2010 but need to check that my machine was 64 bit capable or not...and my mentor found this tool on Google :)






Download the Download version 1.53 32-bit (.zip, no install, english) if your machine is 32 bit and you want to check that is it 64 bit capable?




Also running on .exe it display hardware insights like Graphics,ram(its slots),processor etc etc...



I really found it useful.


Thanks,

Nitin Sharma


Tuesday, February 9, 2010

Business Calendar with different event colors- Color coded Calendar in Sharepoint

Hey Everyone,
One requirement occured in our Sharepoint Project was : a Business Calendar with different colors with different events.After googling i came across a wonderful tool which does everything which i need.Moreover it can be customised too....

The tool can be downloaded from here
The source where i found was the author's Blog


It was wondeful..and i got everything that i need for my Sharepoint Project.

Thanks,
Nitin Sharma

Monday, February 8, 2010

Color Picker Tool for MOSS 2007/Sharepoint

Hello,
I found a wonderful Color Picker tool for MOSS 2007.It is awesome tool.You can download it for free from here

Thanks,
Nitin Sharma

How to find the Size of Database File and Log File

Hi all,
I just went through Pinal Dave's Blog Today and found a very simple script for finding out the Database File Size and the Size of the Log file.Here it how it goes :

SELECT DB_NAME(database_id) AS DatabaseName,
Name AS Logical_Name,
Physical_Name, (size*8)/1024 SizeMB
FROM sys.master_files
WHERE DB_NAME(database_id) = 'AdventureWorks'
GO

For detailed post you can visit here


Thanks Pinal for such a wonderful script..



Thanks ,

Nitin Sharma


Tuesday, January 19, 2010

Fetching Sharepoint User Information dynamically

Hi All,
In sharepoint A user account Information can be fetched out on the fly like Name,Picture,Attachments,About Me etc etc.
In a requirement of my Project i need to find the attachment of the Sharepoint User.

First of all let me know you all that when a user is created Sharepoint internally creates a List called as "User Information List".From this list we can get everything related to SharePoint User.

So here i go with the code snippet:


SPSite objSite = new SPSite(http://YourServerName/YourSiteName);
SPWeb objWeb = objSite.OpenWeb();
SPUser spusr = objWeb.CurrentUser;
SPList list = objWeb.SiteUserInfoList;

SPUserCollection users = objWeb.SiteUsers;
objWeb.AllowUnsafeUpdates = true;
string userId = Request.QueryString["UserId"].ToString();
string userName = "";
foreach (SPUser us in users)
{
if (userId == us.ID.ToString())
{
userName = us.LoginName;
}
}
SPListItem LstItem = list.Items.GetItemById(Convert.ToInt32(userId));
Tempimage.ImageUrl = LstItem.Attachments.UrlPrefix + "/" + LstItem.Attachments[0].ToString() ;



Well the catch here is the Last 2 lines where u give the attachment(here a JPeg image) its source.TempImage is an ASP:Image control.


Similary if you want to update the Profile Picture of a SP User..here you may go like this.

Microsoft.SharePoint.SPList list = web.Lists["User Information List"];
Microsoft.SharePoint.SPUser u = web.SiteUsers["domain\user1"];
Microsoft.SharePoint.SPListItem it = list.Items.GetItemById(u.ID);

it["Picture"] =”http://sharepointApp/sites/wss/photos/abc.jpg”;
it.Update();

Also, you are able to add a custom field to user profile like this:

Microsoft.SharePoint.SPList list = web.Lists["User Information List"];if (!list.Fields.ContainsField("Favorites")){ list.Fields.Add("Favorites", SPFieldType.Text, false); list.Update();}



Do visit for more ideas:
http://www.zimmergren.net/archive/2008/06/25/sharepoints-hidden-user-list-user-information-list.aspx

http://furuknap.blogspot.com/2009/08/sharepoint-user-information-list.html

http://vspug.com/jimyang/2006/12/05/update-wss-3-0-user-profile-programmatically/


Hope it helps.


Thanks,
Nitin Sharma