Tuesday, March 31, 2009
System.Data.SqlClient.SqlException: Login failed for user 'MachineName\ASPNET'
Wednesday, December 10, 2008
.Net Tips

You can add tasks and comments to your solution. We can view the comments from the View menu --> Task List (Ctrl + W, T) which helps us to keep track of the TODO changes we left behind.
Monday, December 8, 2008
Disable button after clicked once
So we can achieve this by disabling the button in the OnClientClick event of the button using javascript. But the problem is after disabling the button, it doesn't invoke the server click event even though we return true in the client event.
Thursday, December 4, 2008
Sunday, November 30, 2008
Wanna to Learn the Microsoft Interview Proc?
Take It!
Sunday, November 23, 2008
Good Morning - Wonderful Story! Don't Miss It
Monica's mother gave her a newly opened bank saving passbook.
With Rs.1000 deposit amount.
Mother: 'Monica, take this passbook. Keep it as a record of your marriage
life. When there's something happy and memorable happened in your new
life, put some money in. Write down what it's about next to the line. The
more memorable the event is, the more money you can put in. I've done the
first one for you today. Do the others with Hitesh.When you look back
after years, you can know how much happiness you've had.'
Monica shared this with Hitesh when getting home. They both thought it
was a great idea and were anxious to know when the second deposit can be
made.
This was what they did after certain time:
- 7 Feb: Rs.100, first birthday celebration for Hitesh after marriage
- 1 Mar: Rs.300, salary raise for Monica
- 20 Mar: Rs.200, vacation trip to Bali
- 15 Apr: Rs.2000, Monica got pregnant
- 1 Jun: Rs.1000, Hitesh got promoted
..... and so on...
However, after years, they started fighting and arguing for trivial
things.They didn't talk much. They regretted that they had married the
most nasty people in the world.... no more love...Kind of typical
nowadays, huh?
One day Monica talked to her Mother:
'Mom, we can't stand it anymore. We agree to divorce. I can't imagine how
I decided to marry this guy!!!'
Mother: 'Sure, girl, that's no big deal. Just do whatever you want if you
really can't stand it. But before that, do one thing first. Remember the
saving passbook I gave you on your wedding day? Take out all money and
spend it first. You shouldn't keep any record of such a poor marriage.'
Monica thought it was true. So she went to the bank, waiting at the queue
and planning to cancel the account.
While she was waiting, she took a look at the passbook record. She looked,
and looked, and looked. Then the memory of all the previous joy and
happiness just came up her mind. Her eyes were then filled with tears. She
left and went home.
When she was home, she handed the passbook to Hitesh, asked him to spend
the money before getting divorce.
The next day, Hitesh gave the passbook back to Monica. She found a new
deposit of Rs.5000. And a line next to the record: 'This is the day I
notice
how much I've loved you thru out all these years. How much happiness
you've brought me.'
They hugged and cried, putting the passbook back to the safe.
Do you know how much money they had saved when they retired? I did not
ask.I believe the money did not matter any more after they had gone thru
all the good years in their life.
"When you fall, in any way,
Don't see the place where you fell, Instead see the place from where you
slipped.
Life is about correcting mistakes!"
ADO .net Sync service on VS using Sql Server 2005
I am going to furnish you a set of steps to follow in order to configure the SQL Server 2005 in VS for ADO. Net synchronization.
If you would have read my previous blog on What is Synchronization and How they work, it will be a piece of cake for you to follow these steps.
I am going a head to describe the steps thinking that you have basic knowledge on ado.net synchronization.
- Create a new project in Visual Studio, preferably Windows application
- Add a new item called “Local Data Cache” ( This item will be displayed in the dialog only if you have installed the SQL Server Compact Edition 1.0 or higher)
- The filename will have a extension of .sync
- Once the new item is added you will have a screen to configure items.
a) You can select the server connection, if you have any of those in the dropdown or click the New button to create a new Sql server 2005 connection
b) Same way you can select the client connection or click the New button to create a New SQL Compact Edition ie, only Compact edition of sql server can be used as client and not SQL express
c) Click the Add button below the Cached Tables to add the table which you want to be synchronized with the Server
d) Click the “Show Code Example” link in the right most bottom of the screen and copy the code to the clipboard( a button will be there to do the operation). I will tell you were to use the this code.
e) Click OK, so that at the first time the data will be downloaded from the server to the client database.
f) It will also try to create a dataset, just click cancel.
g) For synchronization the schema of the table in the server and client will be modified and the script for this will be place in the current solution in a folder called “SQL Scripts” and “SQL Undo scripts”. This scripts does nothing but add two columns to your table for keeping track of the changes happened in offline and to sync with the Server tables. Column name “CreationDate” and “LastEditDate”
- Now you can open your compact database .sdf and verify the table which will have all the data that are in the server with two additional columns
- Go to the view code of the .sync file and specify the Sync direction for your local database cache item. You will have different enum for Sync Direction. Since here we are going to synchronize both the client and server, specified as Bidirectional
Ex. this.DataElement.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional;
- Now just create a form to update you client database table with values which are not updated in the server.
- Put a button in the form and paste the code you have in the clipboard in the click events.
- Now do some updates in the screen and see if the data is updated in the client and not in the server.
- Then click the button(sync button) which will execute the two line code and update the server and same can be done vice versa by updating the data in the server table and doing a sync, which will update in you local database.
I hope you got a glimpse on how to work on ado.net sync. I will explain in my next article on how to do the same with SQL Server 2008