Monday, December 05, 2005

Recovering Shift+Deleted Mails from outlook

Go to Run and type regedit

2) Go to:
\HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\EXCHANGE\CLIENT\OPTIONS registry key.

3) Right click options and add new DWORD VALUE (data type is REG_DWORD) and then right click and rename to DumpsterAlwaysOn. It is case sensitive.

4) Then right click and modify the value to 1 to turn the Recover Deleted Items menu choice on for all folders or enter 0 to turn it off.

5) Then go to Outlook , choose "Recover deleted items" option from the Tools
Menu to get back your "permanently deleted" mails!

Wednesday, September 28, 2005

A Gift..........

A Gift . . .

What have I done,
to deserve this gift I've received..?
It is a gift without comparison,
that is more precious to me than can be believed.

I don't know why I've been blessed,
with such a heavenly gift.
And if this is truly a dream,
then I never want this sleep to lift.

Why you chose to give me this gift,
is more than I can see.
But in return I promise,
that you will never lose me.

I will stay by you always;
never letting you fall.
And if you are ever in danger,
I will defend you until I fall.

For you are a gift,
that I hope never to lose.
And for as long as I live I'll know,
no gift in this world deserves to be cherished more than you . . .

Tuesday, September 27, 2005

Moving or deleting the ViewState from the page

' This method overrides the Render() method for the page and moves the viewstate ' from its default location at the top of the page to the bottom of the page.
This ' results in better search engine spidering. '

Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
Dim stringWriter As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter)
MyBase.Render(htmlWriter)
Dim html As String = stringWriter.ToString()
Dim StartPoint As integer = html.indexOf("
("Dim EndPoint As integer = html.indexOf("/>", StartPoint) + 2
Dim viewstateinput As String = html.Substring(StartPoint, EndPoint - StartPoint)
html = html.Remove(StartPoint, EndPoint - StartPoint)
Dim FormEndStart As integer = html.indexOf("") - 1
If FormEndStart >= 0
Then html = html.insert(FormEndStart, viewstateinput)
End If
End If
writer.Write(html)
End Sub

Wednesday, September 14, 2005

Unwritten Laws - But very true.

Law of Mechanical Repair:
After your hands become coated with grease, your nose will begin to itch.

Law of the Telephone:
When you dial a wrong number,you never get an engaged one.

Law of the Alibi:
If you tell the boss you were late for work because you had a flat tire, the next morning you will have a flat tire.

Variation Law:
If you change queues, the one you have left will start to move faster than the one you are in now.

Bath THEOREM
When the body is immersed in water , the telephone rings.

LAW OF CLOSE ENCOUNTERS The probability of meeting someone you know increases when you are with someone you don't want to be seen with.

LAW of the RESULT
When you try to prove to someone that a machine won't work, it will.

LAW OF BIOMECHANICS
The severity of the itch is inversely proportional to the reach.

THEATRE RULE At any event, the people whose seats are furthest from the aisle arrive last.

LAW OF COFFEE
As soon as you sit down to a cup of hot coffee, your boss will ask you to do something which will last until the coffee is cold.

Tuesday, September 06, 2005

Doing Interop with Win32 APIs in DotNet

PINVOKE.NET attempts to address the difficulty of calling Win32 or other unmanaged APIs in managed code (languages such as C# and VB .NET). Manually defining and using PInvoke signatures (also known as Declare statements in VB) is an error-prone process that can introduce extremely subtle bugs. The rules are complex, and if you make a mistake, you’ll probably corrupt memory.
Therefore, this site is a repository where you can find, edit, and add PInvoke signatures, user-defined types, and any other information that helps us leverage each other's efforts. Think of this as the 21st century version of VB6's "API Text Viewer," a standalone application which used static files such as WIN32API.TXT as input. Did you spend hours figuring out how to successfully define & call a given unmanaged API in managed code? Share (and get credit for) your discovery here! Is there an error on this site? Go ahead and fix it!

Thursday, August 25, 2005

A Poem to my Dear Friend(s).......

Dear Friend . . .

We might not meet, we might not chat,
but we would still be friends,
you better don't forget that..

Times would go passing by,
changes would come with you and I,
our lives destiny would shape,
as with time progress we make.

Distance would take us away miles & miles,
we might not even see each others smiles.
We might not help each other;
but still let not,our friendship wither..

Remember the moments which we share..
no matter, now you are where
you would then miss me
but in your memories I will be..

The magic of friendship would call me
and I would miss you then
thinking..
together we would be when . .

Monday, August 22, 2005

Lots there for the Long Weekend in London

The Long weekend is fast approaching and the plans were read just a couple of days back.
Our rooms actual plan is to go to Scotland, ooops!!! its tooooo late to plan it now, so the plan has been changed and we are going to go to Isle of wight.......and other places....

Moreover am goin to use my new Sony DSC-V3 to the max, gotta see the real limits of it, will post the pictures on my website.

More on my next blog, when i return from the trip.

Friday, August 05, 2005

Quality of Life Dosent Change.......read along...

A group of working adults got together to visit their University lecturer.
The lecturer was happy to see them. Conversation soon turned intocomplaints about stress in work and life.

The Lecturer just smiled and went to the kitchen to get an assortment ofcups - some porcelain, some in plastic, some in glass, some plain lookingand some looked rather expensive and exquisite.The Lecturer offered his former students the cups to get drinks for themselves.

When all the students had a cup in hand with water, the Lecturer spoke:"If you noticed, all the nice looking, expensive cups were taken up,leaving behind the plain and cheap ones.

While it is normal that you onlywant the best for yourselves, that is the source of your problems andstress.
What all you wanted was water, not the cup, but we unconsciouslywent for the better cups.""Just like in life, if Life is Water, then the jobs, money and position insociety are the cups.

They are just tools to hold/maintain Life, but thequality of Life doesn't change.""If we only concentrate on the cup, we won't have time to enjoy/taste thewater in it."
-Mother Teresa

Thursday, August 04, 2005

Some Tools and stuff about creating DOS Batch files.

Stumbled upon this site, searching for a date subtraction statement to write in a .bat file.
http://www.bookcase.com/library/software/msdos.util.batch.html

Monday, August 01, 2005

How do I name my variables and functions in C#.

Confused over the naming conventions to follow for your project,
check this link from Ms.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconnamingguidelines.asp

3rd Dimension Tour by A.R.Rehman.

A.R.rehman's 3rd dimention world tour started from London, I guess its one of his favourite destinations and his studies in the music college in london (ooops!! forgot the name of the college).

The show was absolutely stuning with the Wembley Arena running full with 10K ppl waiting to here the mind blowing live performance of A.R.Rehman and his troupe.

To add to the enchantment were the other great singers, Shankar Mahadevan, Hariharan, Alka yagnik, Kailesh Kher and many others.......

We were a group of 17 ppl who managed to get the venue 20 minutes late, blame the Transport for london guys for scheduling the Engineering works on a Concert day like this.......but managed with the Rail replacement services.

To say in simple words the show was simply awesome.
I could even ask for a 'Once More please..................'

Its beeeeeeeeeeeeeen 3 months.................

Its been 3 months since i updated my blog, i have come to London on an assignment and was not able to blog.....
Now i guess I should be able to be on track.....

waaaaaaaaaah.......wat a sigh of relief...!!!

Wednesday, May 25, 2005

Accessing Parent form Properties in Another ASPX form using Context.Handler.

If you have some properties in a Web form and you need then in another from that is transferred using Server.Transfer method.

This is helful by not using session variables or Query strings.

Create a property in the Parent Web form.
Add this line below the @ directive on the target page.

<% Reference Page="Parentpage.aspx" %>

Now in the code behind of the child page, declare a varaible of type Parentpage.

Private PG Parentpage.

A reference to the parentpage can be obtained using the Context.Handler property like this.
PG = (WebForm3)Context.Handler;

all public properties and methods of Parentpage can be accessed by PG.

Thursday, May 19, 2005

Travelling to London????? Need Transport help?

if you are a travelling to london and need info on the routes, distances and the transport facilities in london, check out this site, wonderful site with interactive maps.

http://www.tfl.gov.uk/tfl/

Thursday, May 05, 2005

Windows ComboBox is different from Web dropdown list....

Basically the windows combobox is slightly different from the Webforms's Dropdownlist.
Web dropdown provides a ListItem class to store Text and Value for the dropdown.

To add Text and Value parts to a Windows combobox do this,
Create a new class and name it myListItem and add two properties to it name Text and Value.
Follow the code below to get it working......

Code to populate the combobox.
=======================
comboBox1.Items.Add(new myListItem("1","11"));
comboBox1.Items.Add(new myListItem("2","22"));
comboBox1.Items.Add(new myListItem("3","33"));
comboBox1.Items.Add(new myListItem("4","44"));
comboBox1.Items.Add(new myListItem("5","55"));

comboBox1.DisplayMember = "Text"; //should refer the property defined in the class
comboBox1.ValueMember = "Value"; //should refer the property defined in the class

Code to Read selected items from combobox.
================================
((myListItem)comboBox1.SelectedItem).Value;

myListItem Class Code block.
=====================

public class myListItem
{
private string _Text;
private string _Value;
public myListItem(string sText, string sValue)
{
Text = sText;
Value = sValue;
}
public string Text
{
get
{
return _Text;
}
set
{
_Text = value;
}
}
public string Value
{
get
{
return _Value;
}
set
{
_Value = value;
}
}
}

Wednesday, May 04, 2005

The Mindset of a Software Pro......

The name is good, the brand is big
But the work I do is that of a pig
The work or the brand, what is my way?
I dont know if I should stay.

To work, they have set their own way
Nobody will care to hear what I say
My will be NULL, they wont change their way
I dont know if I should stay.

The project is in a critical stage
But to do good work, this is the age
This dilemma is killing me day by day
I dont know if I should stay.

The money is good ,the place is great
But the development is at a very small rate
Should I go for the work, orwait for pay
I dont know if I should stay.

The managers dont know what they talk
The team doesnt know where they walk
That's a bad situation, what say?
I dont know if I should stay.

I can go to any other place
But what if I get the same disgrace
I cant keep switching day by day
I dont know if I should stay.

The -ves are more, the +ves are less
Then why have this unnecessary mess
No more will I walk their way,
Its all done, I won't stay.

Monday, May 02, 2005

HTML, Elements, Events, and Back with ASPX pages

There are so many instances when we might have to prevent the user from clicking the back button, or might have to prevent the user from navigating to a page by directly typing in the URL......

This link gives an insight on doing some similar activities with the browser...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebteam/html/webteam07032000.asp

Using Microsoft Visual Studio .NET to deploy Microsoft .NET Framework applications with Dotnetfx.exe

This article describes how to use Microsoft Visual Studio .NET to deploy Microsoft .NET Framework applications with Dotnetfx.exe, the .NET Framework redistributable package.

Click on the link to read more....
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/vsredistdeploy.asp

Have a Weekend plan in and around Bangalore/Mysore

Come weekends and Iam pretty sure we were waiting for those 2 days,
and if your an adventerurer and a nature lover like me, then am sure you cannot be reached on your cell phone nor in your home.

Here is a good link to visit for details on accomodation and facilities available there......
http://www.junglelodges.com/

Wednesday, April 27, 2005

Getting the Screen size using Javascript Code.

To determine the screen size on the client machine, use the properties screen.width and screen.height supported by version 4 of both major browsers. If your user has Netscape Navigator 3 and enables Java, you use a Java call to get the screen width and height.

Click on the link above to see the Example.

Tuesday, April 26, 2005

A good site on Javascript Faqs and other Internet Related Technologies

This site has a couple of commonly used Javascript functions and FAQs on Javascript and articles on all Internet related Technologies......

Executing a Batch file using C# Code.

Take a look at the Process class in the System.Diagnosticsnamespace.
Namespace - System.Diagnostics
Here is a sample to get you started:

ProcessStartInfo startInfo = null;
Process batchProcess = null;
bool finished = false;
// Write relatively well behaved code for
// service processes.
try {
// Prepare the start-up information for the
// process such as filename to execute, its
// arguments, how to execute and whether to
// redirect input and error.

startInfo = new ProcessStartInfo();
startInfo.Filename = "run.bat";
startInfo.Arguments = "arg1 arg2 arg3 arg4";
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
// Start new process using the start info.
batchProcess = new Process();
batchProcess.StartInfo = startInfo();
batchProcess.Start();

// Wait 60 seconds for the process to exit.
finished = batchProcess.WaitForExit(60000);

// If true, the process exited cleanly, if false
// then the process is still running.

if (finished == true) {
// Log that the process exited cleanly.
EventLog.WriteEntry( "The batch process exited cleanly." );
}
else {
// The process didn't exit cleanly so kill
// it off and log the action to the Event Log.
batchProcess.Kill();
EventLog.WriteEntry("The batch process did not exit in time and was killed.");
}
} catch (Exception e)
{
// Things can and will go wrong, at this early
// stage it is probably sufficient to write this to
// the event log. Of course, what do you do if access
// to the event log is denied? Can happen . . .
EventLog.WriteEntry( e.Message);
}

Einstein’s revolution enters second century

‘Miracle year’ still echoes as physics faces new challenges
During the "miracle year" of 1905, Albert Einstein published five groundbreaking papers still sparking innovations 100 years later.
Slide show

Also check out the photographic timeline spanning the life of Albert Einstein.

Life of genius
View a By Alan Boyle
Science editor
MSNBC
Updated: 12:08 p.m. ET April 19, 2005
Just after the turn of the century, scientists knew that their fundamental theories weren't quite right — they just didn't know what to do about it.

Monday, April 25, 2005

How To Implement Role-Based Security with Forms-Based Authentication in Your ASP.NET Application by Using Visual C# .NET

Link taken form microsoft, the article describes the methods to Implement Role-Based Security with Forms-Based Authentication in Your ASP.NET Application by Using Visual C# .NET

Wednesday, April 20, 2005

Using JavaScript Window.Open() & Close() functions in Ur Dotnet Apps

window.Open Function
----------------------------------

The window.open() function allows us to control the way a new window is opened, you can choose to have the toolbar, the address bar or even have a fixed dialog window which cannot be resized.

All these are controlled based on the parameters passed to the open method, lets look at each one of them.

*************************************************************
The "LINKS" or "EXTRAS" toolbar.
window.open("page1.htm","width=400,height=300,directories=yes");

The address or URL toolbar.
window.open("page1.htm","width=400,height=300,location=yes");

The toolbar with FILE, EDIT, VIEW, etc....
window.open("page1.htm","width=400,height=300,menubar=yes");

Allows the visitor to be able to resize the new window or not.
window.open("page1.htm","width=400,height=300,resizable=yes");

Forces vertical scrollbars to appear or not. Rarely used property.
window.open("page1.htm","width=400,height=300,scrollbars=yes");

The status bar along the bottom of the browser window.
window.open("page1.htm","width=400,height=300,status=yes");

The toolbar with BACK, FORWARD, REFRESH, etc...
window.open("page1.htm","width=400,height=300,toolbar=yes");

The height n width of the new window in pixels.
window.open("page1.htm","width=400,height=300");
*************************************************************

All the above parameters can be clubbed together to get a window of our choice.
Specifying only the WIDTH and HEIGHT options will automatically set the other properties to "no". Only the title bar holding the minimize/maximize buttons will be displayed on the window. To get the other settings to show, they will have to be specfied as "yes" explicitly.

window.close Function
----------------------------------

To close the current window just say
window.close()

But how do i close the child window by clicking a button on the parent window.
Provide a name for the child window when you open it
Ex: window.open("URL","Name","parameters");
window.open("page1.aspx","MyExamle","parameters");

Now you have to call the close method on the window name like this
Ex: MyExample.close();

Now by using the Name property you can use all the object available for the window object and manipulate the child window.

The example below changes the Url of the child window to show a new url.
Ex: MyExample.location.href("Webform2.aspx")

Hope this section provided you with some basic information on using the Open and close methods of the window object in Javascript and how to manipulate child window views.

Passing Textbox value form a Child Window to Parent Window Using JavaScript...

There are many a time when you might want to open a child window for showing a calendar and returning the selected value to the parent form text box,

Here's how to do it using JavaScript.

Open the HTML view of the child form, include this as a javascript function and call it on Unload of the child form or on button click.

window.opener.document.getElementById('txtParent').value = window.document.getElementById('txtChild').value

In the parent form you can open the child window by using window.open in the Response.Write method.
Check out my other post on the using the window.open parameters.

Passing Textbox value form a Child Window to Parent Window Using JavaScript...

There are many a time when you might want to open a child window for showing a calendar and returning the selected value to the parent form text box,

Here's how to do it using JavaScript.

Open the HTML view of the child form, include this as a javascript function and call it on Unload of the child form or on button click.

window.opener.document.getElementById('txtParent').value = window.document.getElementById('txtChild').value

In the parent form you can open the child window by using window.open in the Response.Write method.
Check out my other post on the using the window.open parameters.

Tuesday, April 19, 2005

Need a Block Menu in CSS?....its right here.....

Need a block menu fast!
Below are simple CSS menu designs for you to download and use any way you see fit.
You can download the complete set, or an individual menu by clicking the Download Menu button located on each menu.
Thanks to Veerle for the tutorial on the menu design 3, the best looking menu here.
Please feel free to download for commercial or private use, and modify to suit your needs.
Creative Commons - Attribution 2.0 - designed by Ian Main - e-lusion.com

Wednesday, April 13, 2005

Discusses how to use XMLHTTP to update part of a Web page with data from an ASP.NET Web service without doing a post back

A good presentation on using XMLHTTP................
Click on the link above to read on..................

http://www.kbalertz.com/Feedback_893659.aspx

My DotNet App is not Connecting to SQL Server 2000 after a change in IP address for SQL server...why?

There was heated exchange of mails in our company's internal knowledge Bulletin board.
One of my colleague was not able to make her ASP.net web app to run properly.

The SQL server 2000 Server IP address was changed, and after that the ASP.net application does not run.
The app runs fine if impersonated with the line identity impersonate =true is added to the web.config file, which was not the case before.

What might be the reason for this, after a long list of mails finally got the solution from a fellow employee in China.......

*********The Solution***********

The problem is caused by the IP address modification. Please follow the steps to locate the reason:
1. Login to the server where the SQL Server is deployed.

2. Execute SqlDiag.exe to gather information of the SQL Server.
By default, the SqlDiag.exe is under: C:\Program Files\Microsoft SQL Server\MSSQL\binn3. Open the log file generated by the SqlDiag.exe, check the IP address the SQL Server instance is listening.

By default there are three lines which are related with the IP address the SQL Server listen to. For example:

2005-03-30 14:38:36.65 server SQL server listening on 172.21.240.84: 1433.
2005-03-30 14:38:36.65 server SQL server listening on 127.0.0.1: 1433.
2005-03-30 14:38:36.68 server SQL server listening on TCP, Shared Memory, Named Pipes.

In above example, the first line is the IP address of the Server, the second is the lookback ip address, and these two are used to support TCP/IP connection to SQL Server. The third is for named pipeline protocol, which is defaulted enabled.

4. For your problem, mostly is because the SQL Server is still listening to the old IP address. Because the IP address has been changed, and SQL Server’s configuration is not changed, the client can not connect to SQL Server via TCP/IP protocol anymore.

5. If the problem can be located in step 4, the reason that why does the SQL Server can be connected while the “” is configured will be clear.
It’s because that the client application first selects TCP/IP to connect to the SQL Server.
If it is failed, the client application will try to use named pipeline. For named pipeline, it requires authentication before connecting. So, without the line in the Web.Config file, the link via named pipeline can not be established.
So, the client can not access SQL Server

Finally the fight is over........................

Tuesday, April 12, 2005

Using XMLHTTP in Javascript

Stumbled upon a cool posting on using XMLHTTP with javascript, the example posts a code to populate a dropdown list based on the value selected on another.

When I automate an Office application, it remains in memory even after I call Quit(). Why?

There have been a lot of Questions on releasing the COM objects when using Office applications with web apps.
Above is a link to a site that explains how to gracefully clean up the objects.

Also check out this link at the MS site.
http://support.microsoft.com/?kbid=317109

Article Url:
http://www.dotnetinterop.com/faq/?q=OfficeCleanup

Thursday, March 31, 2005

Solution for "Cannot start debugging on web server, Access is denied" error when trying to run Asp.net Application

You may receive an "Access is denied" error message when you try to debug a Web application, and you have administrative permissions in Visual Studio .NET
Article ID
:
894433
Last Review
:
March 25, 2005
Revision
:
2.0
On this page

SYMPTOMS

CAUSE

RESOLUTION


MORE INFORMATION


REFERENCES
SYMPTOMS
You may receive the following error message when you try to debug a Web application:
Access is DeniedThe problem occurs when the following conditions are true:

You are logged on to your computer with administrative permissions.

You are debugging a Web application in Microsoft Visual Studio .NET.

The operating system that you are using is Microsoft Windows XP Service Pack 2.

The Microsoft ASP.NET worker process account is not a member of the Administrators group.
CAUSE
The problem occurs because the ASP.NET worker process does not have the Impersonate a client after authentication user right. If the worker process account does not have this right, the debugger cannot attach to the process. The worker process account is configured by using the processModel element in the Machine.config file.
RESOLUTION
To give the worker process account the Impersonate a client after authentication user right, follow these steps:
1.
Click Start, point to Settings, and then click Control Panel.
2.
Double-click Administrative Tools.
3.
Double-click Local Security Policy.
4.
Expand Security Setting, expand Local Policies, and then click User Rights Assignment.
5.
In the Policy pane, right-click Impersonate a client after authentication, and then click Properties.
6.
Click Add User or Group.
7.
Add the worker process account that is configured in the processModel element in the Machine.config file.
8.
Click OK two times.
9.
Click Start, click Run, type iisreset, and then click OK.
10.
At a command prompt, type the following command to refresh policies on the computer:
gpupdate /forceMORE INFORMATION
Steps to reproduce the problem
1.
Open the Machine.config file. Locate the processModel element.
2.
Replace the username attribute and the password attribute as a non-administrative user.
3.
Restart Internet Information Services (IIS).
4.
Log off your computer. Log on your computer so that you have administrative permissions.
5.
Start Visual Studio .NET.
6.
Create a new Web application.When you try to debug the Web application, you may receive the following error message:
Error while trying to run project: Unable to start debugging on the web server. Access is denied.REFERENCESFor more information about developing software in Visual Studio .NET that has non-administrative permissions, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/tchDevelopingSoftwareInVisualStudioNETWithNon-AdministrativePrivileges.asp

Wednesday, March 16, 2005

Code to Open an IE Window from a Windows Form in C#

Process p = new Process();
p.StartInfo.FileName = "iexplore.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
p.StartInfo.Arguments = www.google.com
p.Start();

Tuesday, March 01, 2005

A code snippet in C# to get the installed path for MS Office using Registry Keys

private string GetOfficeAppPath(string sProgId, string sEXE)
{
//Returns path of the Office application. e.g.
//GetOfficeAppPath("Access.Application", "msaccess.exe") returns
//full path to Microsoft Access. Approach based on Q240794.
//Returns null if path not found in registry.

// Enable exception handler:
try
{
Microsoft.Win32.RegistryKey oReg =
Microsoft.Win32.Registry.LocalMachine;
Microsoft.Win32.RegistryKey oKey = null;
string sCLSID = null;
string sPath = null;
int iPos = 0;

// First, get the clsid from the progid from the registry key
// HKEY_LOCAL_MACHINE\Software\Classes\\CLSID:
oKey = oReg.OpenSubKey(@"Software\Classes\" + sProgId + @"\CLSID");
sCLSID = oKey.GetValue("").ToString();
oKey.Close();

// Now that we have the CLSID, locate the server path at
// HKEY_LOCAL_MACHINE\Software\Classes\CLSID // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}\LocalServer32:
oKey = oReg.OpenSubKey(@"Software\Classes\CLSID\" + sCLSID +
@"\LocalServer32");
sPath = oKey.GetValue("").ToString();
oKey.Close();

// Remove any characters beyond the exe name:
iPos = sPath.ToUpper().IndexOf(sEXE.ToUpper()); // 0-based position
sPath = sPath.Substring(0, iPos + sEXE.Length);
return sPath.Trim();
}
catch
{
return null;
}
}

ONE BEDROOM FLAT... AN INDIAN SOFTWARE ENGINEER'S LIFE... - A Bitter Reality

As the dream of most parents I had acquired a degree in Software Engineer and joined a company based in USA, the land of braves and opportunity.When I arrived in the USA, it was as if a dream had come true.

Here at last I was in the place where I want to be. I decided I would be staying in this country for about Five years in which time I would have earned enough money to settle down in India.

My father was a government employee and after his retirement, the only asset he could acquire was a decent one bedroom flat. I wanted to do some thing more than him. I started feeling homesick and lonely as the time passed. I used to call home and speak to my parents every week using cheap international phone cards. Two years passed, two years of Burgers at McDonald's and pizzas and discos and 2 years watching the foreign exchange rate getting happy whenever the Rupeevalue went down.

Finally I decided to get married. Told my parents that I have only 10 days of holidays and everything must be done within these 10 days. I got my ticket booked in the cheapest flight. Was jubilant and was actually enjoying hopping for gifts for all my friends back home.If I miss anyone then there will be talks. After reaching home I spent home one week going through all the photographs of girls and as the time was getting shorter I was forced to select one candidate.

In-laws told me,to my surprise, that I would have to get married in 2-3 days, as I will not get anymore holidays. After the marriage, it was time to return to USA, after giving some money to my parents and telling the neighbors to look after them, we returned to USA.

My wife enjoyed this country for about two months and then she started feeling lonely. The frequency of calling India increased to twice in a week sometimes 3 times a week. Our savings started diminishing. After two more years we started to have kids. Two lovely kids, a boy and a girl,were gifted to us by the almighty. Every time I spoke to my parents, they asked me to come to India so that they can see their grand-children.

Every year I decide to go to India. But part work part monetary conditions prevented it. Years went by and visiting India was a distant dream. Then suddenly one day I got a message that my parents were seriously sick. I tried but I couldn't get any holidays and thus could not go to India. The next message I got was my parents had passed away and as there was no one to do the last rights the society members had done whatever they could. I was depressed. My parents had passed away
without seeing their grand children.

After couple more years passed away, much to my children's dislike and my wife's joy we returned to India to settle down. I started to look for a suitable property, but to my dismay my savings were short and the property prices had gone up during all these years. I had to return to the USA.

My wife refused to come back with me and my children refused to stay in India. My 2 children and I returned to USA after promising my wife I would be back for good after two years.

Time passed by, my daughter decided to get married to an American and my son was happy living in USA. I decided that had enough and wound-up every thing and returned to India. I had just enough money to buy a decent 02 bedroom flat in a well-developed locality. Now I am 60 years old and the only time I go out of the flat is for the routine visit to the nearby temple. My faithful wife has also left me and gone to the holy abode.

Sometimes I wondered was it worth all this? My father, even after staying in India, had a house to his name and I too have the same nothing more.

I lost my parents and children for just ONE EXTRA BEDROOM.

Looking out from the window I see a lot of children dancing. This damned cable TV has spoiled our new generation and these children are losing their values and culture because of it. I get occasional cards from my children asking I am alright. Well at least they remember me.

Now perhaps after I die it will be the neighbors again who will be performing my last rights, God Bless them. But the question still remains 'was all this worth it?'




I am still searching for an
answer................!!!!

By an Indian SE who was in US.

Develop Microsoft Office Solutions with Visual Studio .NET

This link is a wonderful link to almost all the requirements of working with office applications with DotNet,
As a hardcore dotnet developer I know the pains involved in interacting with office apps with DotNet,
but this site is a treasure hunt.

Searching for that piece of VBA code for access-Excel issues???

****This Sub writes the values form an XL sheet to an access table.****

Private Sub Command16_Click()

Dim lngColumn As Long
Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Set xlx = CreateObject("Excel.Application")
'xlx.Visible = True
Set xlw = xlx.Workbooks.Open("E:\csvfiles\test.xls")
Set xls = xlw.Worksheets(1)
Set xlc = xls.Range("A2")
Set dbs = CurrentDb()
Set rst = dbs.OpenRecordset("testtable", dbOpenDynaset, dbAppendOnly)
Do While xlc.Value <> ""
rst.AddNew
For lngColumn = 0 To rst.Fields.Count - 1
rst.Fields(lngColumn).Value = xlc.Offset(0, lngColumn).Value
Next lngColumn
rst.Update
Set xlc = xlc.Offset(1, 0)
Loop
rst.Close
Set rst = Nothing
dbs.Close
Set dbs = Nothing
Set xlc = Nothing
Set xls = Nothing
xlw.Close False
Set xlw = Nothing
xlx.Quit
Set xlx = Nothing

MsgBox "Data Loaded"








'Dim db1 As DAO.Database
'Dim rs1 As DAO.Recordset
'Dim qdf1 As QueryDef
'Set db1 = CurrentDb()
'Set qdf1 = db1.CreateQueryDef("")
'qdf1.SQL = "SELECT * INTO testtable FROM [Excel 8.0;database=E:\csvfiles\test.xls;].[Sheet2$]"

'Dim SQL1 As String
'Dim qdef As QueryDef

'SQL1 = "SELECT * INTO testtable FROM [Excel 8.0;database=E:\csvfiles\test.xls;].[Sheet2$]"
'CurrentDb.Execute "qdf1"

'Set rs1 = qdf1.OpenRecordset()

'DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "testtable", "E:\csvfiles\test.xls", True, "myrange2"
End Sub

****This Sub writes the values form an access table to an XL sheet.****

Private Sub Command17_Click()
Dim xlx As Object, xlw As Object, xls As Object, xlc As Object
Dim db As Database, rs As Recordset
Dim intColIndex As Integer
Dim TargetRange As Range
Set xlx = CreateObject("Excel.Application")
xlx.Visible = True
Set xlw = xlx.Workbooks.Open("E:\csvfiles\test.xls", ReadOnly:=False)
Set xls = xlw.Worksheets(2)
Set TargetRange = xls.Range("A1")
Set TargetRange = TargetRange.Cells(1, 1)
Set db = CurrentDb()
Set rs = db.OpenRecordset("testtable", dbOpenTable) ' all records
'Set rs = db.OpenRecordset("SELECT * FROM " & TableName & _
" WHERE " & FieldName & _
" = 'MyCriteria'", dbReadOnly) ' filter records
' write field names
For intColIndex = 0 To rs.Fields.Count - 1
TargetRange.Offset(0, intColIndex).Value = rs.Fields(intColIndex).Name
Next
' write recordset
TargetRange.Offset(1, 0).CopyFromRecordset rs
Set rs = Nothing
db.Close
Set db = Nothing

End Sub

Friday, February 25, 2005

Forgot that Connection String....?? U'll find it right here.

A wonderful site that lists the connection strings to connect to all kinds of database.
Have a look at it....

Tuesday, January 18, 2005

"Queen of Hill Stations" - OOty Trip writeup

It is really a long weekend, its called "Pongal" in Tamilnadu and "sankaranthi" in Karnataka.
Whatever it is named, we have holidays for 3 days.
Visiting the home town is a common scene for outstation ppl like me, but am not like that, I love travel , adventure and Driving!!!!!!!, Ameen khan another room mate also form chennai, we r on similar wavelengths, he too loves travel , adventure and driving, getting people with similar thoughts seems a bit difficult.

The plan to make use of this holidays was charted out 2 weeks before and my friend suggested Ooty!!!!!!!!
Ahhhh what a place to be in, at this point of the year, its not an off-season nor a peak-season, its called a second season, no huge rush nor any harsh rains.

Our plans started taking up shape as we neared the D-day.
We a group of 9 guys started of in 5 bikes, mine is a black victor, a CBZ, pulsar, yam135, and a black fiero started from bangalore on 14-Jan-2005, Friday.
My bike has completed its 6000 and its the first long trip above 250 kms at-a-stretch ride, and I was determined to get to know its full potential in the winding 36 hairpin bends of ooty.

Our actual plan was to start at 5:00Am, myself and ameen khan were on the dot, picked up rajesh (on his pulsar) from indranagar, went to koramangala and picked up 2 more guys mayank and gaurav.
Headed to banshankari (opp to family mart) this is our proposed meeting point to start the journey, Sudheep (CBZ) and abhijeet r still in their house in cox town and Kris (yam135) still not to be found.
Atlast we found the 3 guys turning in at 6:30Am.
Without wasting a second, we started of on the kanakapura road, ameen and gaurav on ameens fiero, myself and kiran on my Victor.
We were heading for quite a distance and found the other 3 bikes missing form the vision, so was waiting near a tree, we got a call form kris and felt sorry to hear Kris bike going flat.
We found a puncture shop near the tree and informed them to get the wheel, rajesh had removed the wheel by then and got it to the shop, got the tube back into shape in half an hour,
It was a nail a really big nail that was in the tyre.
It was around 8:00Am we again started the trip form the kanakapura road.
Reached kanakapura, had our breakfast there and headed straight to mysore via mallavalli.

From mysore we headed straight to Ooty road via Masinagudi, bandipur mudumalai.
Before entering Bandipur, we spotted a Resort (nilgiris resort), the food was awesome, had a south indian style meals, rested for some 15 mins and started our journey again into the jungle roads.
The jungle stretch was the ultimate riding, we spotted a lot of Deers and elephants on the way
The next awesome road was after the mudumalai jungles, the road was a straight layer of bitumen, it seemed as if it was freshly done.

The major Fun part of the steep ascend in the nilgiri hills was about to start, we encountered the first hairpin bend, the winding ride sent a chill through the spine, we stopped at every hairpin joint to capture the beauty of nature, also we cant count the number of tea's that we had on the way, we havent had so much in our life time, wherever we find a tea shop, the engines would come to a halt, it seemed as if the engines started doin this automatically.

Reached ooty at 5:00pm, rode upto our hotel in charring cross (Hotel Glanton Manor), we booked the rooms a week in advance, and we had a warm welcome from the hotel with 1 big room for 6 people and a another small room for 3 people.
We had a good sleep on friday night, woke up at 7:00 next morning on Saturday, visited parsons valley dam, pykara and other places.

The places were exciting and am falling short of words to describe the scenic beauty.
We started or journey back to bangalore on sunday and reached bangalore at 6:00Pm.

In totality the trip was an exciting one with 9 guys and 5 bikes roaring the roads.

Tuesday, January 11, 2005

OOOOTY Bash..........

A sudden plan to go to ooty was planned for the 14th of Jan 2005, 8 guys form HP and myself, all having a long weekend, dosent do justice to it, if we were to waste them sitting in our homes like a couch potato.

So why not plan a trip, a long trip, definitely 300Kms is not long, but is definitely long going by Two wheelers.

9 ppl, 5 bikes, am sure the trip is gonna be awesome XP for all...........
Couple of them are my old frnds, and i have some new faces to get acquainted.......

1 more to the team should make it 10, else there will be a bike goin all alone (hoping i can pick up some chick on the Way).

Rest of the write up after the trip......

Unexpected Errors in Managed Applications

This Article features "handlinh Unexpected errors in managed applications.
Click on the link above to Read more................

In this installment of the .NET column I am going to present a handful of tips for dealing with unexpected errors. While it is common practice to catch exceptions to deal with expected failure cases, it is also common for managed applications to encounter errors for which the application is completely unprepared. In an ideal world you will establish clear policies for how your application discovers and responds to unhandled exceptions, reduced security permissions, and other related edge-cases, but in practice these are often overlooked.
Error handling infrastructure is a deceptively complex topic, and you can easily be overwhelmed by details, so I'll address a few relatively simple operations that are broadly applicable for dealing with unexpected err....................................................
http://msdn.microsoft.com/msdnmag/issues/04/06/NET/default.aspx

Monday, January 10, 2005

FxCop is a code analysis tool that checks .NET ............

FxCop is a code analysis tool that checks .NET managed code assemblies for conformance to the Microsoft .NET Framework Design Guidelines.
It uses reflection, MSIL parsing, and callgraph analysis to inspect assemblies for more than 200 defects in the following areas:

Library design
Localization
Naming conventions
Performance
Security

FxCop includes both GUI and command line versions of the tool, as well as an SDK to create custom rules.

Download FxCop 1.312
FxCop for .Net 1.1
FxCop self-extracting installer (3.7 MB, 12/09/04)
FxCop .msi installer (3.8 MB, 12/09/04)

Wednesday, January 05, 2005

Microsoft .NET Application Blocks


.NET Application Blocks are distinct pieces of code, created by the
Microsoft Patterns and Practices Team, that demonstrate the best practices on how to accomplish a specific task using .NET. They are ready made code that you can use/extend to make your lives a WHOLE lot simpler.
I like them as they are extensively tested and reviewed (which hopefully minimizes security issues).


User Interface Processes Application Block v 2.0

http://www.microsoft.com/downloads/details.aspx?FamilyId=98C6CC9D-88E1-4490-8BD6-78092A0F084E&displaylang=en
The User Interface Process Application Block provides a simple yet extensible framework for developing user interface processes. It is designed to abstract the control flow and state management out of the user interface layer into a user interface process layer.

Smart Client Offline Application Block
http://www.microsoft.com/downloads/details.aspx?FamilyId=BD864EB5-56B3-43A5-A964-6F23566DF0AB&displaylang=en
The Offline Application Block, is intended to serve as an architectural model for developers who want to add offline capabilities to their smart client applications.

Authorization and Profile Application Block
http://www.microsoft.com/downloads/details.aspx?familyid=ba983ad5-e74f-4be9-b146-9d2d2c6f8e81&displaylang=en
The Authorization and Profile Application Block provides you with an infrastructure for role-based authorization and access to profile information.

Logging Application Block
http://www.microsoft.com/downloads/details.aspx?FamilyId=24F61845-E56C-42D6-BBD5-29F0D5CD7F65&displaylang=en
This block is a reusable code component that uses the Microsoft Enterprise Instrumentation Framework (EIF) and the Microsoft .NET Framework to help you design instrumented applications.

Aggregation Application Block
http://microsoft.com/downloads/details.aspx?FamilyId=9058F345-E5FE-42FC-B40B-14EBDD182F48&displaylang=en
The Aggregation Application Block is a .NET Framework extension that allows you to easily manage and coalesce information from various service providers and other systems and present that information to users.

Caching Application Block
http://microsoft.com/downloads/details.aspx?FamilyId=B55164C9-94C8-4077-AA29-AFE4074746DE&displaylang=en
The Caching Application Block has been designed to encapsulate Microsoft's recommended best practices for caching in .NET applications

Configuration Management Application Block
http://www.microsoft.com/downloads/details.aspx?familyid=85cb1c53-8ca7-4a92-85e3-e4795bd27feb
The Configuration Management Application Block is an easy to use mechanism through which you can read and write application configuration data.

Data Access Application Block v 2.0
http://www.microsoft.com/downloads/details.aspx?FamilyId=F63D1F0A-9877-4A7B-88EC-0426B48DF275&displaylang=en
The Data Access Application Block encapsulates performance and resource management best practices and can easily be used as a building block in your own .NET application. If you use it, you will reduce the amount of custom code you need to create, test and maintain.

Persistent Asynchronous Invocation Application Block
http://microsoft.com/downloads/details.aspx?FamilyId=794EC811-B5EA-46AE-BAA4-69A3DEADD38E&displaylang=en
The Microsoft Asynchronous Invocation Application Block manages asynchronous communication between a Web client and one or more foreign service providers (FSP).

Updater Application Block
http://www.microsoft.com/downloads/details.aspx?familyid=c6c17f3a-d957-4b17-9b97-296fb4927c30
In medium to large organizations, it is common to want to keep all instances of a desktop application up to date with the latest version of executables, libraries, and other files. The Updater Application Block provides an extensible framework that companies can use to create updateable applications

Exception Management Application Block
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=8CA8EB6E-6F4A-43DF-ADEB-8F22CA173E02
The Exception Management Application Block provides a simple yet extensible framework for handling exceptions. With a single line of application code you can easily log exception information to the Event Log or extend it by creating your own components that log exception details to other data sources or notify operators, without affecting your application code. The Exception Management Application Block can easily be used as a building block in your own .NET application.

Sunday, January 02, 2005


Hi...Guys this is meee... Posted by Hello

My Site is Up...........

I wanted to host my site on new year 2005, after burning some midnight Oil for a couple of days before new year......
finally got my site revamped and have hosted it with Brinkster.

Now my site has some cool and new looks.......


Windows Service Administration with ASP.NET

Just came across a good blog, while searching for an idea to implement something in remoting for my project.

http://dotnetjunkies.com/WebLog/bsblog/archive/2003/11/12/3504.aspx

Wishing all a Happy New Year 2005

Hi all......

With a New Year tats not too impressive nor festive, dur to the recent tsunami hits.
Not in a mood to Party.........

Just slept in my house, after wishing my frnds a happy new year 2005 at 12:00