Dynamically show image in Silverlight

I had a requirement to show images in Silverlight dynamically and that was quite simple can be done in two steps in a minute but I spend nearly hours to figure out the issue.

Dynamically show images from code behind

var bitmapImage = new BitmapImage(new Uri(“http://www.google.co.in/intl/en_com/images/logo_plain.png”);
image1.Source = bitmapImage;

The above code will make you smile only if you run the application from the silverlight web application project and not the default genarated testpage.html

The whole point is that this scenario works only if the application is hosted or run from an local web application with fileserver.

Note: Only JPG,PNG,BMP works this way and GIF doesn’t go well. Check this post to make GIF work


SharePoint DB an Overview

The SharePoint heart is SQL it acts as the brain behind the scenes. SharePoint installed on a server edition OS uses the Internal Database by default. You can manually configure SharePoint to pick the SQL server on Configuration. To check the instances running on the machine you can use the SQL Configuration manager.


The above picture shows two instances Internal Database and SQL Express.

Use SQL management studio for easier access. Use the instance to connect to appropriate instance and expand the databases to view the db attached to the particular instance


The default configured would have three db’s by default

_AdminContent  (Central Admin)

    The central administration db will be generally one per farm.

Wss_Content (Site Content)

    The content database is created one by default that can hold 15000 sites
This can be created separately for each application created in the farm to have control over the growth of the db.

Find the content db in your farm

Central Admin >>Application management >> Content Databases

Wss_Search (Search Index)

This is only applicable if only search index is enabled for the farm.

Note: The default database created will have the following settings auto growth (db would grow as the data increases) and no size limit for the db file. This applies for both the .MDF(SQL Database) and .LDF(SQL Log)

The procedure that can avoid the situations. The following are my personal view and take necessary backup before you proceed.

Pre – Action
  1. Connect to instance with Management studio
  2. Right-Click the db properties


3.Select the Files and you can see two files the db and the log

4.Click the button in the Autogrowth button and you will find the following window.

image5. Set the Restricted file growth as plan and that size should be greater than the existing file.


Post – Action

The Pre-action would help once a new server is setup. The main case is everyone miss this step and finally once log grows huge they search around for an solution. Check this might help. The below is my view and take precautions before giving a try.

  1. Stop SharePoint services and IIS
  2. Connect to the SQL Instance
  3. Expand the Databases item
  4. select the db right click >>Tasks >> Detach
  5. Rename the log file of the detached db
  6. Attach the db manually using the following query in SQKlMGmt
  7. sp_attach_single_file_db @dbname= ‘databasename’, @physname= ‘C:\Databases\databasefile.mdf’

7. Start SharePoint services and IIS that generates a new log file.

SharePoint web service a Beginner guide

The post gives a basic Idea about the web services inbuilt with the SharePoint which can be used in other types of desktop application and Silverlight application.

    The SOAP request has to be sent in the web request body to get the response from the web service.
    eg: SOAP call for getting the WebCollection.

"<?xml version=""1.0"" encoding=""utf-8""?> 
<soap12:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope""
    <soap12:Body><GetWebCollection             xmlns=""http://schemas.microsoft.com/sharepoint/soap/"" /> 

    The most commonly required url’s for interrogating with the SharePoint web. Replace the localhost with your SharePoint server url and hit the enter and you will see the SOAP request and reply format.

    • http://localhost/_vti_bin/Webs.asmx – sites and sub sites
    • http://localhost/_vti_bin/Lists.asmx – Lists
    • http://localhost/_vti_bin/Alerts.asmx – Alerts
    • http://localhost/_vti_bin/DspSts.asmx –Schemas and data
    • http://localhost/_vti_bin/DWS.asmx – Document Workspaces
    • http://localhost/_vti_bin/Forms.asmx –User interface forms
    • http://localhost/_vti_bin/Imaging.asmx – Picture libraries
    • http://localhost/_vti_bin/Meetings.asmx – Meeting Workspaces
    • http://localhost/_vti_bin/Permissions.asmx – SharePoint Services security
    • http://localhost/_vti_bin/SiteData.asmx – SharePoint Portal Server
    • http://localhost/_vti_bin/Sites.asmx – Site templates
    • http://localhost/_vti_bin/UserGroup.asmx – Users and groups
    • http://localhost/_vti_bin/versions.asmx – File versions
    • http://localhost/_vti_bin/Views.asmx -  views of lists
    • http://localhost/_vti_bin/WebPartPages.asmx – Web Parts

    Hope this gives a basic idea about web services and the further post will explain in making a web service call.. 

    Top Twitter Apps

    Twitter is the most spoken word of the year 2009. I started tweeting only mid of this year but I love tweeting it shares the information both personal and the technical. The friends who follow you will be up to date.I don’t have to call and check what are you up to ?

    This really helps people stay in touch.

    The apps that I found to be the best ones.


    Witty – http://code.google.com/p/wittytwitter/

    Seesmic – http://seesmic.com/ (Updated 20/6)

    Desktop Gadget (Vista / Win 7)

    Tweetz – http://blueonionsoftware.com/gadgets.aspx

    Google Desktop


    iPhone / iPod Touch /MAC


    http://itunes.apple.com/app/twitter/id333903271?mt=8 (Updated 20/6)





    Java Based

    Snaptu – http://www.snaptu.com/  (Updated 20/6)

    Fring – http://www.fring.com/  (Updated 20/6)

    Hope this helps the newbie.

    If you find something interesting and I have missed it feel free to comment on it.

    Chrome OS Review

    Today I got a chance to preview Chrome OS and I would like to share the experience.

    Downloaded the chrome VM and loaded it on my PC.

    It didn’t login at first and finally found the trick to use the login name chromium to login.

    • Google Chrome OS focuses on three things Speed, Simplicity, Security
    • All data on Chrome OS is in the cloud
    • Chrome OS looks like Chrome browser
    • User data on machine is always encrypted and always synced to the cloud – local data is just a cache
    • Cold reboot demo – to logon screen in 7 sec, full OS in another 3 sec
    • It can be used on Netbooks.
    • Chrome OS is open source and you can download it from here

    VM download – http://gdgt.com/google/chrome-os/download/

    Direct VM – http://tiny.cc/4iOOw

    Install and develop SharePoint applications on Window 7 – 64 Bit

    I used to develop web parts in windows 2008 server and it was pretty sluggish and felt bad to use a server OS as a desktop machine. So I thought could try installing SharePoint over windows 7. I came across issues on first install and gave up and went back to windows 2008. Once I was bored and was keen to find out a way to install SP on windows 7  and finally succeeded.

    Install Procedures

    Install Visual studio 2008 with SQL express edition( this will be used as a DB server)

    I would Thank Bamboo solution for the post http://tinyurl.com/wssonwin7

    Do the following steps mentioned in the above post link and while configuring in the below stage


    use .\SQLEXPRESS this is your internal Express edition instance and your system login credentials.

    finally use the create application to create a base site. Some time you may face an issue the create application may be hidden in the central administration.

    Run Internet Explorer as Administrator to resolve 😛


    I have been using Visual Studio Extensions – VSS 1.2 for a long time with no issues but tried installing VSS 1.3 and it turned out odd and didn’t work pretty well on the first try but finally succeeded. VSS1.3 looks cool has lot new features ease of deployment and debugging.

    VSS 1.3

    If you face any issues in using VSS1.3 first check the web service running in the IIS namely VSSEWSS try to open the address in browser and it should open up with a default page or try you need to register WCF with IIS and update its scriptmaps. to do this,

    1. Navigate to %SystemRoot%\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\
    2. Execute ServiceModelReg.exe -i

    more info on this tool can be found here:


    VSS 1.2

    If you plan to go with VSS 1.2 over 64 Bit use this tool ORCA MSI Editor to remove 32 Bit check

    1. Run VSeWSSv12.exe

    2. Copy C:\Program Files (x86)\MSECache\vsewssv12.en-us to a temp folder

    3. Open Orca (from the platform SDK) and load VSeWSSv12.msi

    3. Remove the following lines

    • InstallExecuteSequence>X64System
    • InstallUISequence>X64System
    • InstallExecuteSequence>WSSNotInstalled
    • InstallUISequence>WSSNotInstalled

    4. Run edited MSI

    Download Links

    WSS 3.0 32 Bit http://tinyurl.com/wss3sp2x86

    WSS 3.0 64 Bit http://tinyurl.com/wss3sp2x64

    VSS 1.2 32 Bit http://tinyurl.com/vss12

    VSS 1.3 32 Bit http://tinyurl.com/vse13-x86

    VSS 1.3 64 Bit http://tinyurl.com/vse13-x64

    ORCA http://www.technipages.com/wp-content/uploads/2007/11/orca.Msi

    Feel free to comment if you face any issues that may help others.

    Introduction to SharePoint Web Part


    Refer the following link



    Life Cycle

    The methods are called in the following order.

    OnInit – Configuration values set using WebBrowsable properties and those in web part task pane are loaded into the web part. Initialize the values here.
    LoadViewState – The view state of the web part is populated over here. (When its a post back)
    CreateChildControls – All the controls specified are created and added to controls collection. When the page is being rendered for the first time the method generally occurs after the OnLoad() event. In case of postback, it is called before the OnLoad() event. We can make use of EnsureChildControls() – It checks to see if the CreateChildControls method has been called and if not it would call it.
    User Generated Event – for e.g. button click on the web part.
    OnPreRender – Here we can change any of the web part properties before the control output is drawn.
    RenderContents – Html Output is generated.
    SaveViewState – View state of the web part is serialized and saved.