Congratulations! We are pleased to present you with the 2009 Microsoft® MVP Award! - Vikram Lakhotia

Hi,

 



Dear Vikram Lakhotia,

Congratulations! We are pleased to present you with the 2009 Microsoft® MVP Award!

 


Continued...

Using event handler in Sharepoint to make any column unique

Hi,

 

Many a times in a Sharepoint list we want to have one of the columns to act as a unique column. But there is no easy way to do it.

 

There are a couple of ways to make this happen,

Continued...

Running Commands with Elevated Privileges in Windows Sharepoint Services 3.0

Hi,

 

Few days back while coding for a webpart in a Sharepoint site, I had to check the roles of all the groups the user was linked to. The code to do it seems to be very simple.

Continued...

Site outage and Back
Hi,

The site was down for last few days. The problem was with my hosting provider. who got the site down without intimidating me in any way. After lots of complaining the site is back up and running.

Its feels so relaxed when the site comes back after such a long outage without any reason. I just hope this does not happen again........

Vikram

CTP of Visual Studio 2010 and dot Net framework 4.0 released by Microsoft

Hi,

Continued...

Now you can get SMS alert for My blog in India

Hi,

As soon as I saw the new service from Google (SMS channel) that can take RSS feed and use it to send SMS update to all the subscriber, i decided to use it in my blog.

I thought it would be great for some of the user who would like to have SMS update when a new blog is added.

You can subscribe to the SMS update by clicking on the link. You will have to verify your mobile. All you need for this service is an google account and a mobile number to recieve the SMS updates.

http://labs.google.co.in/smschannels/subscribe/VikramLakhotia_TechBlog

Unfortunately this service is only available in INDIA. so people in other country will have to wait till this service is available in their country.

Vikram


Sharepoint Getting SPWeb object in Itemdeleting event through properties

Hi,

 

A few days ago I was working with Item deleting event in the share point. I had to update some of the referenced items in the other records in the same list when an item was being deleted.

 

Continued...

Microsoft releases Silverlight 2.0

Hi,

 

Microsoft has released the latest version of Silverlight technology to release. SilverLight2 final version was released by Microsoft yesterday. You can download Silverlight 2, as well the Visual Studio 2008 and Expression Blend 2 tool support to target it, here.

 

Continued...

Working on Attachment object SPFile in a share point list

Hi,

While working with share point, many a times, when you are working with list item you have attachments with the list item. Many a times you want to programmatically access these attachment files (as SPFile objects). The SPListItem also exposes a collection of all the Attachments with the help of the property Attachments. But this list is nothing but a collection of string containing the filename of the Attachment.

To get to work with the actual SPFile object for each attachment, this will not help much. There are two way to get the SPFile object for the attachments.

SPFolder folder = web.Folders["Lists"].SubFolders[list.Title].SubFolders["Attachments"].SubFolders[listitem.ID.ToString()];

Continued...

SP1 for Visual studio 2008 and dot net framework 3.5 out

Hi,

Microsoft has released sp1 for dot net framework 3.5 and visual studio 2008 The SP1 has following feature update for


Dot Net framework
Asp.Net Dynamic data
Asp.net Ajax Browser history

Asp.net Ajax Script combining

Ado.Net data services

Ado.net entity framework

The SP1 for visual studio 2008 also has many notable bug fixes. You can find a list of the fixes here.

 

Continued...

Using Rowcount and Top keyword for controlling number of records returned

Hi,

Many a times in a query we need to limit down the number of records returned in the query. This can be done in two ways using the TOP keyword or the row count keyword.

Select top 10 from Table

This will return the top 10 records from the query. We can also make this dynamic by making the Value in Top keyword to come from a variable.

DECLARE @top INT
SET @top = 10
SELECT TOP(@top) * FROM Table

Continued...

Programmatically Embedding another file to the word document

Hi

Many a times we want to embed some document in the word file, with the help of Insert-> File-> Select File menu item. This will copy the content of the file to the word document. This can also be done programmatically. 

String LocationOfFileToMerge = "C:\\Myfile.doc";

range.InsertFile(LocationOfFileToMerge,ref oMissing, ref oFalse, ref oFalse, ref oFalse);

We can also embed the document in the word file instead of copying the text of the document. In this case you can embed any kind of document.


Object NameForLabel = "File Name";

Continued...

Word Automation and Basic text formatting option

Hi,

when you start working with word programmatically, many a times you will have to add some text in the word document with formatting. Word automation gives you easy way top format the text that you are writing in the Word document programmatically.

To make the same impact as would an enter button in the word document we can use the following code.

oWord.Selection.TypeParagraph();

Basically this will enter a new paragraph in the word document. But you are in a bullet mode than this will take you to next line and also add the next bullet in the sequence.

Some of the common word formatting functionality can easily be performed with the help of word automation.

Continued...

Word automation and find and replace in Word document

Hi,

In My last two posts I talked about

·         How to open and close a word document programmatically.

Continued...

Saving word document in different format using Word Automation

Hi,

In my last post I talked about how to open and close a word document programmatically. In this post I will talk about how we can save the word document.

While using a word document there can be three kind of save functionality that can be required.

1.       When we open an existing word document and make some changes to the word document and save the word document.

Continued...

Microsoft word 2007 automation with C Sharp

Hi,

Some time in our project we need to work with word (winword) document programmatically. Word provides a good way to automate nearly all the functionality that can be used through interface.  The process of programmatically working with word document is commonly termed as word Automation.

I will be using a series of blogs to discuss some of the functionality that can be achieved through word automation. In this Blog I will discuss how we can start programmatically open a new or and existing word document and close it.

To work with word 2007 automation we need to have the word 2007 installed in the machine where the application will run. When we install the word 2007, it also installs with it the com component required to automate word 2007.

Continued...

Large Blob Data problem in Oracle stored procedure

Hi,

Few days back I was working with Oracle database and one of my stored procedures which was inserting a blob data to the database.  But I started getting a strange when the data in the blob data type got large. For large blob data I was getting the following error.

ORA-01460: unimplemented or unreasonable conversion requested.

The system would work consistently for small files but for large files I was getting this error.  After Doing a bit of Google I found that this is a drawback of using stored procedure in Oracle database.  If you try to pass over 32 Kb (or greater than 32512 char of string) then oracle will give this error in case of Blob data type.

Continued...

Using Lazy Loading Design pattern to load data when required

Hi,

Some time when you are working with large objects where some of the data (properties in the object) is not required frequently, the use of Lazy loading is the best.

 Let’s say you have an Object which contains many properties along with a property for exposing long XML string. The long XML string is only required to be shown only a few times when you are also showing the details of the object. At this point when we are loading a list of this object to display (where by XML string will not be displayed) its not a good practice to also load the XML string in the object. Since this would take lots of extra Network bandwidth and memory space.

Continued...

Visual Studio 2008 and dot net frame work 3.5 service Pack 1 beta out

Hi,

Yet another big news for dot net frame work 3.5 and Visual studio 2008. Microsoft has released the beta 1 of the Dot net frame work 3.5 and visual studio 2008. Some of the major issues taken care of in the service pack are

·         Various fixes to issues found by Microsoft and our Customers

Continued...

Get current GMT Time in Oracle and MSSQL

Hi,

Many a time with all the data we want to store the current date time for reference purpose.  If your application is going to work with more than one country than its best to store the date time in UTC (GMT) format.  With difference database the way to get the current UTC date time is different. Here is a list of way to do the same for different database.

Oracle 9i and above

select new_time(sysdate,'EST','GMT') into Result  from dual;

Don’t forget to change EST with the current time zone of the database.

MS SQL 200 and above

GETUTCDATE()

Continued...

Asp.Net List Box control and flickering issue

Hi,

Last few days I was working on a page which had lots of list box in it which had multi select option. My master page also had a Menu control for the navigation purpose.  One major problem I was facing was with the flickering of the List box as soon as take my mouse over the menu.

Continued...

Handling Dropdown list inside Gridview with Autopostback

Hi,

Many a times there are circumstances where by we need to use dropdown list inside a Gridview and also handle the index changed event of the dropdown list. The easy example of this kind of requirement would be when we nee to fill another dropdown list in the same row from the value selected in the first dropdown list.

We all know that the dropdown list does not support command name property so you cannot handle the event in the row command event.

Continued...

Sorting and Paging Gridview without datasource control

Hi

Many a times while working with Gridview we want to work with the paging and sorting functionality without using any datasource control. Gridview is flexible enough to perform these tasks without the use of any datasource control and only a few lines of code.  

For paging a Gridview manually we have to handle the Gridview’s PageIndexChanged Event.  In the event we need to change the PageIndex of Gridview to the page that user has clicked and again bind the Gridview.

Continued...

Open format design awards goes to Microsoft Open Office XML

Hi

Microsoft has won international standards designation for its open-document format, according to voting results obtained Tuesday, apparently ending a divisive yearlong battle with software rivals before a global standards-setting organization.

Vikram


IIS7 gets many new admin tools

Hi

Its been a few days that I have not been able to post blogs. I have been very busy these while. But yesterday I found this blog which talks about lot of cool new admin modules for IIS7.  The blog also explains how to use the modules. Do check it.

Vikram


Creating a list of the data cached at a point in the asp.net Application cache

Hi,

 

We all know about the use of caching in our application. With good use of cache we can increase the performance of the application considerably since application does not have to process the stuff again and again. But if we use too much of caching in the application, it can be problem. After all the data in the cache has to be stored in the memory and most of the application have limited memory. And more so in case of shared hosting.

 

Continued...

Reading, writing and deleting cookies in client side using JavaScript

Hi,

 

I have discussed about cookies in my previous posts. But in all those posts I talked about working with cookies in server side.

You can read these posts here

 

Continued...

SilverLight 2.0 Beta 1, Asp.net MVC preview and IE8 Beta1 out to public

Hi,

 

Seems like Microsoft has decided to go for many releases on a day on the first day of MIX. Yes today Microsoft not only announced the release of IE8 Beta1 but also the preview of the Asp.Net MVC and Silverlight 2.0 Beta 1. This is way too much to work on at the same time. But who is complaining. :-)

 

Continued...

IE8 beta 1 is out for grab

Hi,

 

The beat 1 of the most dominated web browser’s next version is out for grab and it comes with many features too. The IE8 Readiness Toolkit which will give a detailed description of the features. You can download the same here.

 

Some of the new features are

 

Continued...

Going mouse less using keyboard shortcut in Asp.Net

Hi,

 

Many a times when working with the Web Application you would like to give the user the comfort of getting the job done without using the mouse. It can be of great use to the user if they can perform many tasks using the keyboard in a web application. If you have used Gmail you would know how easy it can be to select mails using some key.  This feature can be implemented in Asp.net also very easily.

 

Continued...
 
Copyright © 2006 - 2009 Vikram Lakhotia