Sunday, April 18, 2010

Thinking Of You

Just you are in my mind,
And you are my miss world..

Please clarify my confusion,
In a, rush of people
Only you are visible
Is this a reality or illusion..

In the season of sunny skies
want to be a nightingale
and tweet you for mingle
under the shade of cloudy skies..

your presence,make my heart play
like, the strings of guitar
plucked by a rockstar
making me , fly high in sky..

you always present in my dreams
oh god make me a nightbird
open my dream doors
let me realize the romance..

You are, the beautiful person
shocked, on your first glance
there is only one desire,
that you be my life companion..

May be i am a hummingbird
but,gifted with wings of archangel
can fly towards the heaven
to persuade god to make you smile..


when you walk back
gives me immense pain
either, tell me god how to sustain
or give me , the time back..


Just you are in my mind,
and you are my miss world..

Written By : Mahendra Apte

Saturday, April 17, 2010

change connection string in app.config programmatically/Runtime

Step 1 : Create a New  windows Forms application named configwrite

Step2 :  On Form put a button and a label

Step 3 : In code behind on click event of the button write the code
            shown below

 private void button1_Click(object sender, EventArgs e)
        {
Configuration c =        System.Configuration.ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
      c.ConnectionStrings.ConnectionStrings["connectionstring"].ConnectionString = "SERVER=changedservername; DATABASE=database; uid=username; pwd=password;";
            c.Save();
            label1.Text = "Connection String Changed";
      }

Note : The change in connectionstring is reflected in the
          configwrite\bin\debug\configwrite.exe.config  File

Sending SMS from asp.net through way2sms...

C#.net:




Step 1: Add Web Reference : 
        http://www.spiritssoft.com/webservice/sendway2sms.asmx


           //if your classname is classname1 and servicereference is ServiceReference1


Step 2: Add This "using classname1.ServiceReference1;"


Step 3:

            SendWay2SmsSoapClient client = new SendWay2SmsSoapClient();
            string strResult = client.sendSmsSpiritsSoft("username", "password",                   "number to send","message");

Thursday, April 15, 2010

Clear event logs


This is needed when your defined log file size for database is limited..Badly needed during
debugging stored procedures.


Clear Sql log files >>>


Step 1 : open visual studio >> open view menu >> your server name>>Event Logs --->rt click>>launch eventviewer
Step 2 : Event Viewer window opens
Step 3 : Event viewer(local) >>application --->rt click >> Clear All Events :)

Sunday, April 11, 2010

Swap bit values of a column using update query

Suppose there is a situation in which
There is column named pass/fail.which has default values 1/0
Respectively.
Now by mistake you have inserted it as 0 for pass and 1 for fail.
Now you need to update but you cannot do it easily because,

If i write query like this "update result set pass=1 where pass=0"
or update result set fail=0 where fail=1
this will surely create a havoc.
So, we need to toggle both bit values at a time
For which you can write it as
update result set pass=pass ^1 
this is called XOR operation


This will do the task happy Querying...:-)