June 18, 2008 by dotnetolympians
In your Visual Studio IDE go to the projects (at the top) -> add references -> com (tab) -> add the Microsoft Excel library installed.
Or you can use the project explorer.
Right click on the references-> add references -> com (tab) -> add the library.
Please refer to the image below.

Then simply what you need to do is Import the Excel.
Imports Microsoft.Office.Interop.Excel for VB
using Microsoft.Office.Interop; for C#
The “Microsoft Excel X Object Library” where X will depend on whatever version of Excel you have in the computer.
So the X depends on which version of Excel is installed on your machine.
Posted in .NET, Tips and Tricks | Tagged .NET, Add new tag, Excel, Visual Studio .NET IDE | No Comments »
June 11, 2008 by dotnetolympians
A lot of you might have come across this problem just like me.
Firstly we create a temporary table.
create table #temp1
(
id Int Identity(1,1),
invoice varchar (20)
)
insert into #temp1 values (’CR’)
insert into #temp1 values (’CR ‘)
insert into #temp1 values (’ CR ‘)
insert into #temp1 values (’ CR’)
Select * From #temp1
where DATALENGTH(invoice) <> len(invoice)
The len function in SQL gives you the length of the characters including the spaces white DataLength excludes the trailing not preceding spaces.
Here if you don’t have the column defined as varchar rather you have an nvarchar field then you simply convert then to varchar before calling the respective functions like this.
Select * From #temp1
where DATALENGTH(convert(varchar(20),invoice)) <> len(convert(varchar(20),invoice))
Happy searching trailing spaces in your db, please share with us if you have better options.
Posted in SQL, T-SQL, Tips and Tricks | Tagged SQL Tips and Tricks, T-SQL, Trailing Spaces | No Comments »
June 1, 2008 by dotnetolympians
Server: Msg 8180, Level 16
Server: Msg 102, Level 15
Server: Msg 1018, Level 15, State 1, Procedure SendReview, Line 12
Incorrect syntax near ‘FASTFIRSTROW’. If this is intended as a part of a table hint, A WITH keyword and parenthesis are now required. See SQL Server Books Online for proper syntax.
Remote tables are not updatable. Updatable keyset-driven cursors on remote tables require a transaction with the REPEATABLE_READ or SERIALIZABLE isolation level spanning the cursor.
We were getting this error from the SQL server job that was running a store procedure inside which we were calling a table that was on a linked server running SQL Server 2005, while the major database was running on SQL Server 2000. We had the linked server setup and it was running fine. We could run queries to this table on the 2005 server without any difficulties.
One thing that I came to find out was the changes in the cursor. Please find details from the following link http://msdn.microsoft.com/en-us/library/ms143359.aspx.
Solution:
1: Either you can have a temp table created out side the cursor to get all the values from across the linked server and then create the cursor over this table.
2: Secondly you can replace the Cursor with a simple loop.
3: Thirdly if possible and you can simply create the Cursor as “FOR Read Only”.
Hope this helps you people to migrate your databases happilyJ.
Well I found the solution from this URL:
http://www.eggheadcafe.com/software/aspnet/31278881/cannot-declare-a-cursor-t.aspx
Thought I should share it with everyone.
Posted in Blogroll | Tagged SQL Server 2005 Migration, SQL Server Tips and Tricks | No Comments »
May 23, 2008 by dotnetolympians
I have been changing machines quite frequently since the last 6 months. And each time I have a new machine I need to setup the environment as I prefer.
The tabs spaces the fonts the immediate window and the list goes on.
But one thing I always forget is where is the setting for the Line Numbers to appear so this blog is for me
Goto:
Tools -> Options -> Text editor- > All languages -> General -> Display (Line Numbers)

Hope this helps other fellow readers as well.
Posted in .NET, Personal Experience, Tips and Tricks, Visual Studio .NET IDE | No Comments »
May 13, 2008 by dotnetolympians
As most of you technology geeks must be using the Windows Server 2008. And a lot might have already ran out of their allocated evaluation period of 60 days J.
But don’t worry it’s not the end of your exploration with this new enhanced server from Microsoft. If you want to extend the evaluation period it’s really simple. I came across an email from a colleague of mine a great developer rather a master mind; thanks Naweed.
So if your 60 days initial evaluation period nears to end just follow these simple steps to increase the period using the Slmgr.vbs script.
1. Click Start, and then click Command Prompt.
2. Type slmgr.vbs -dli, and then press ENTER to check the current status of your evaluation period.
3. To reset the evaluation period, type slmgr.vbs –rearm, and then press ENTER.
4. Restart the computer.
This resets the evaluation period to 60 days.
You can find more ways to of extending this evaluation here in this kb article:
- How to install Windows Server 2008 without activating it
- How to manually extend the evaluation period
- How to automate the extension of the evaluation period
But keep in mind that you can only extend to a max of 240 days (i.e. 3 extensions)
Posted in Personal Experience, Tips and Tricks | Tagged Tips and Tricks, Windows Server 2008 | 1 Comment »
May 4, 2008 by dotnetolympians
I just started off programming using Windows Server 2008 using Visual Studio 2008. So I came across a number of initail applications that anyone would start off with; a couple of desktop apps and a web app. Just going through some forums I found posts of users asking as to how to turn off the Enhanced Security Configurations for Internet Explorer in Windows Server 2008.
As most of you who might have tried Windows Server 2008 might have seen that the menus and the style is changed a lot as to improve the user experience.
So here it is, simply follow these Steps:
1. Click on the Start -> Administrative Tools -> Server Manager

2. Click on the Configue IE ESC

3. On this pop-up you will find the options to turn off the security configurations.

And you can change the configurations for either users or the administrators, depends on what you need.
I would keep on sharing new tips and tricks that I come accorss in programming as well this is just a configurations change.
Posted in Personal Experience, Tips and Tricks, Windows Server 2008 | 2 Comments »
February 1, 2008 by dotnetolympians
Microsoft is looking to curb the divide between the professionals and the IT industry.
So all you students out there get registered here http://www.s2bprogram.com/Pakistan/ for upcoming internships. You will be getting internships posted on this portal from Microsoft partners. This is a great move on the behalf of Microsoft Pakistan and Pasha I really appreciate the great minds on both sides of the partnership. I am really glad to see such a leap being taken for the betterment of IT in Pakistan. I would be personally visiting Software Houses and IT Institutes in Lahore particularly, presenting and encouraging masses on both sides of the divide.
Regards,
Muhammad Arsalan Ayub
User Group Leader/President DotNetOlympians
http://mvp.support.microsoft.com/profile/Arsalan
Posted in Community News, Internships, Microsoft, PASHA, Pakistan User Groups | 8 Comments »
December 14, 2007 by dotnetolympians
Well I had the chance to present on Microsoft Innovation Days here in Lahore, Pakistan.
It was a great experience, something out of this world. I have been presenting on cutting edge technologies for quite sometime now, but this was huge for me. I was presenting to an audience consisting of CEO’s, CIO’s, CTO’s and top level managers of leading organizations in Pakistan.
Well I guess all went as planed (thanks to Almighty) and I was able to introduce this new revolutionary web technology (Microsoft Silverlight) to the masses. I am sharing this presentation with the rest of you here.
I have been following the path Web Applications have taken for the past decade, and I am sure Microsoft Silverlight is going to revolutionize them even further.
| View Show | Create Your Own
Posted in .NET, ASP .NET AJAX, Community News, MVP, Silverlight, Windows Presentation Foundation (WPF) | 1 Comment »
December 13, 2007 by dotnetolympians
I had a great presentation at Strategic Systems International SSI. I loved the audience great interaction and I really appreciate the management of SSI for arranging such a great event.
You can download the presenation from the following URL shortly.
A slideshow of the presentation:
| View Show | Create Your Own
Posted in Community News | 4 Comments »
December 10, 2007 by dotnetolympians
Today I am presenting on the topic “Office Business Applications The Web Tier (SharePoint Portal Server)” in SSI (Strategic Systems International).
Well the topic I had been assigned was Office Business Applications, but due to some change in plan SharePoint came along. So I decided to give a hybrid presentation on “How to develop Office Business Applications using SharePoint Portal”, well apparently the presentation has crossed all boundaries and I am unable to cut its length I hope that my audiences doesn’t get bored, slide after slide.
May Allah Almighty help me in this extremely lengthyyy presentation.
Would be posting the presentation for all shortly.
Posted in Community News, MOSS, Microsoft Office System, SharePoint, VS 2005, WSS, Windows WorkFlow Foundation (WF) | No Comments »