Friday, November 27, 2009

Sorting and updating datatable -- ado.net

Kindly have a look to the parts those are highlighted in the following figure. You'll understand how you can sort the data present in the data table.





Wednesday, November 11, 2009

Trigger in ASP.NET-AJAX

To partially refresh a part of the page, we can use Trigger inside the Update Panel. If we can insert a trigger with an update panel, then only the update panel will be refreshed. To partially refresh a part of the page, we can use Trigger inside the Update Panel.If we can insert a trigger with an update panel, then only the update panel will be refreshed.


Here on the click event of button submit will refresh the page inside the update panel.
Nice and easy way of coding!

Saturday, October 24, 2009

India US national song together -- nice video

This video is a testimony of growing cooperation between India and US. Lets hope two of the most significant democratic country will build more cooperation in future so that world will be enriched more and earth will be a better place to leave.

Respect National Anthem first

We need to respect our nation and for that purpose we need to respect our national anthem first. How a nation can be build without respecting that?
The following video points out that our country will move if and only if we move. I really like the song and the message that has passed with this video.

Saturday, October 10, 2009

Grandmom passed away, left her memory with us

BECAUSE I could not stop for Death,
He kindly stopped for me;
The carriage held but just ourselves
And Immortality.
We slowly drove, he knew no haste,
And I had put away
My labor, and my leisure too,
For his civility.
We passed the school where children played
At wrestling in a ring;
We passed the fields of gazing grain,
We passed the setting sun.
We paused before a house that seemed
A swelling of the ground;
The roof was scarcely visible,
The cornice but a mound.
Since then ’t is centuries; but each
Feels shorter than the day
I first surmised the horses’ heads
Were toward eternity.
--Emily Dickinson
Knowing the fact is that death is unavoidable and one of the few eternal truths of life, we always find it difficult to accept. Couple of months ago, when doctors diagnosed that my Grand mom had Gall Bladder cancer which was in the last stage, we all knew that the death was approaching to her and at her age and in other physical complexity it would be a lost battle but still after her death I feel yet another person with whom I'd spent my childhood , passed away. Now only memories of her will accompany me...

Tuesday, September 15, 2009

Playing with Transaction in .Net 2.0

That's why I love so much about .Net. Recently I came across a scenario where one of my junior colleague is using the old and little bit lengthy way of implementing transaction in C# code. I suggested her to use the single liner crispy TransactionScope in the System.Transactions namespace. I'm just adding a sample code snippet here


Pretty easy, don't you think so? TransactionScope will take care of all the transactional related stuff in the above code block. We need to commit the transaction by calling the ts.Complete() method. As the connection object itself is confined within the scope so it automatically participates in the transaction.(Kindly note as its a code snippet so everything is not defined here properly as its only part of the whole demo project)
Please explore more the transaction context with Transaction.Current. And last but not the least thing that this feature is not limited to SQL Server operations. You can use the same transaction for Oracle, SQL Server data-storages, MSMQ messaging and even bulk copying filesystem operations.


Saturday, September 5, 2009

Airtel Digital TV Advertisement--- good music

Except the last twist the advertisement is simply awesome... sweet music , sweet words. Some part of the lyrics matched with almost everyone's life. If life is a journey then sometimes we need to leave from one place to another and in the process of doing that we have left something!

Saturday, August 15, 2009

Meaning of Freedom


What is freedom?
Is it synonymous with the right to do anything?
Does this give us a right to articulate our feelings as we wish to do so? I’m really confused and hence trying to explore the meaning of the apparently simple word.
Then I have started asking people about their understanding of freedom?
A taxi driver answered that buying his own cab in one day is the freedom for him.
College girl told me that to buy as many as apparels is the definition of freedom for her.
A kid replied to me that if he doesn’t need to go to the school for one day, he’ll consider to be free!!!
One of my friends told me to spend a day uninterrupted in hill station is a freedom for her.
Another said to read the book that he loves through out the day defines the freedom for him.
And for me freedom means:
To write in my blog,
To sing a song or to play a guitar---
To paint on a canvas
To chat with my close friends for hour
To travel to some unknown place
To walk in the drizzle
And to reach at the zenith!!!”

Saturday, August 8, 2009

Confirmation box in winform with yes/ no

Recently I need to write confirmation box in winform and based on the selection of my user (whether user select "Yes" or "no") , some action will be performed.

Lets have a look at the code snippet

DialogResult dResTest;
dResTest = MessageBox.Show( "Do you want to add something ?", "Confirm Document Close", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dResTest == DialogResult.No)
{
Application.Exit();
}
else
{

//Calling some function if user clicks Yes
ViewExistingTicket
();

}

Just use the intelliscense feature, you'll find some other useful properties after giving dot to MessageBoxButtons and MessageBoxIcon

Thursday, August 6, 2009

Using output parameter of SQL Server stored procedure in C#

Recently I need to write a small piece of code for one small module that tracks different tasks of a group of production support worker.
In the first part of this post, I would like to write some part of the code to depict how to use output parameter in store proc. The name of the store proc is

Alter procedure sp_check_dupl_rec
(
@ticketID
nvarchar(80),
@ErrorFlag char(1) out,
@ErrorText nvarchar(4000) out

)
As
BEGIN
set @ErrorFlag
= 0
Select DISTINCT TicketId from tbl_TaskTracker where TicketId = @ticketID
IF @@ROWCOUNT > 0
begin
set @ErrorFlag =1
set @ErrorText ='Ticket that you are going to enter already exists.'

--print @ErrorText
RETURN
end
END

In the second part of the code , I like to write C# code that is showing how do we use output parameter of SQL SERVER stored proc in our C# code to get relevant information.

bool DuplicateData = false;
string strCon = null;
SqlConnection conn = null;
SqlCommand cmd = null;
SqlDataReader rdr = null;
try
{
strCon = System.Configuration.ConfigurationSettings.AppSettings["dbtest"];
conn = new SqlConnection(strCon);
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
cmd = new SqlCommand("sp_check_dupl_rec", conn);
cmd.CommandType = CommandType.StoredProcedure;
SqlParameter oParam = cmd.Parameters.AddWithValue("@ticketID", txtTicketNo.Text);
oParam = cmd.Parameters.AddWithValue("@ErrorFlag", 'a');
oParam.Direction = ParameterDirection.Output;
oParam = cmd.Parameters.AddWithValue("@ErrorText", '0');
oParam.Size = 4000;
oParam.Direction = ParameterDirection.Output;
rdr = cmd.ExecuteReader();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
if (conn != null)
conn.Close();
if (rdr != null)
rdr.Close();
}
int intErrCode = Convert.ToInt16(cmd.Parameters["@ErrorFlag"].Value);
if (intErrCode == 1)
{
string strErrTxt = Convert.ToString(cmd.Parameters["@ErrorText"].Value);
MessageBox.Show(strErrTxt);
DuplicateData = false;
}
else
DuplicateData = true;
return DuplicateData;
}

Please have a look specially at the highlighted part of the above code.
Kindly check prior to open the connection whether the connection has already been opened and don't forget to close the datareader after using it!

Thursday, May 28, 2009

Barca won UEFA Champions League 2009


Thousands of avid soccer fan like me were looking towards this classic final between probably two of the most prolific club in European Football and it was termed as the battle between two of the best players in contemporary football viz Messi and Christiano Ronaldo. Not only this two but also both the teams are loaded with some of the best guys in their business.But as I've seen the match was not that fiercely competitive that we would have thought.Slowly after first few minutes of nervous moments Barcilona had taken the possession of the mid filed and eventually they mounted more pressure to ManU defense.
One exemplary tactics has shown by Barca that they didn't come to the defensive football even after scoring goal within 10 minutes. People often talk about Messi but XAVI and Ineasta also played a fabulous game; specially Ineasta who had shown his class after an excellent goal in the semi-final.
The final match been played by a Swiss Referee and contrary to the allegation that important match only been played by Referees of nations those host Major football leagues , this guy proved his critics wrong.He can claim praise from all of us by such a clean yet firm way to conduct this high pressure match. Lastly the potent team has won the trophy as in any moments of the clash, Barca never seemed to be outplayed by ManU!

Monday, May 18, 2009

Indian Election 09 - A shift in paradigm

After this year General Election, almost all of the Exit Pole predicted that Congress led UPA would get around 205 to 215 whereas NDA could get around 175 to 195. Lastly the 3rd Front could take a deterministic role to form a government.
Now after the result, we saw a clear verdict to the Congress led UPA so that they can't even need the support of the Left. Probably even the blind Congress supporter never thought that the party got the highest number of seats since 1991.
Why there is so much swing?
Lots of people are talking about the fact that electorate understood that the only UPA can provide the stability and hence they casted their vote for UPA. Do you think our electorates are that matured? I don't think so.
Rahul's image has also worked for Congress, true.
Might the projection of Modi as a possible prime minister candidate disrupted the chance of NDA.
But this election probably claim a special position to the Indian History as probably this is the for the first time after a long period, caste dalit votes didn't impact much.
If this is the silver line behind the cloud then there is also some aberration.
In WestBengal TMC inspite of having dirty politics got a majority of the seats. Probably that is the only state where people didn't cast their vote for development.
At the end, we can safely say "Singh is King, Singh is King, Singh is King !!" :-)

Monday, April 27, 2009

Economic turmoil and its impact on us

Just think about those days when the HR executives simply scratch their heads by thinking how they can lure existing employees not to leave from their organization and how to attract new employees with an affordable rates. Even in the placement cells of all business and engineering schools are were buzzing like anything during the time of campusing. Then people suffered by the syndrome of too many and they were in a trouble to decide where to go. And its neither a dream nor a myth ; even 2 years ago these were very familiar scenes to most of the places about which I was talking.
Suddenly things have been going to change rapidly.
Now also HRs are scratching their heads but not for how to retain employees but for how to fire them in a considerable fashion. Employees are struggling how to survive within an organization. Couple of years ago the hard-nosed employee who are very particular about his her work assigned right now they are obliged to do whatever work they have been assigned.
Biggest problem happened probably for the case of value addition. In this way employees have to do all those stuffs those neither contribute anything to their career nor put themselves in a safe and sound position within an organization.
Say if you are doing task X as there are no other work that can be available for you within your organization and the difficulty level of X is such that even a fresher can do that without much hiccups then why your organization needs to pay much higher salary for the same work that can be done by a fresher.
Now we are standing in front of a two edged sword. We can't deny to do task X but by doing the task X you are not moving in a safer or more secured position.
Compared to the corporate world people can think that those people who are doing research , are safe. Yes its true that they are in a better position compared to us but due to lack of funding and inevitable cost cutting they are also feeling the heat.
And in turn people are buying less , trying to save more to secure themselves and hence demand of consumer goods are also declining.
Government even after injecting liquidity to the market , can't make any amendment as there is scarcity of money in the pocket of the common consumer. And its not an easy task to create everything perfectly normal and until then the struggle will prevail, who knows how long?

Saturday, March 21, 2009

Incidence of femdom or caring husband ?

Recently while I was watching a TV commercial , I came across the new ad of Bru coffee where wife came to home after whole days work and she looked tiered. Initially her husband didn't pay any attention to her but after taking a cup of Bru, he took the feet of his wife in his lap and started to give her foot massage.

Now here the point comes. Few people are saying that it's an obscene ad as it's should be banned as its showing feet fetish, femdom . Hence it should not be shown in front of the children who are a major viewer of television.

But I wonder why some people are trying to put things always in such a biased way! Can anyone refute me if I'm saying that the ad is an depiction of a caring husband instead of a submissive one? Am I wrong if I comment that this ad is showing mutual respect between husband and wife and exactly there is nothing wrong to show this in public. Rather children will learn the munificence from that caring husband ; then where is the flaw in my logic? So people should or must have different view about the same thing and that's the beauty of democracy.

Again to fight vehemently for an add is too insignificant and might be some of my reader will laugh at me, but the point where I want people will ponder about is that some self appointed policemen of our culture unnecessarily try to interfere into our personal liking and disliking. Whether it be the Valentine day celebration or the enjoyment of young people in disc in Bangalore, those arrogant people are trying to peep their nose everywhere. Again as we are living in a democratic country so enjoying Valentine day or enjoying in a disc should be some one's personal discretion. We don't require any self appointed guardian who will come and preach us! And these kind of activities have been increasing day by day. So if administration doesn't take stern action now , one day we'll be living like a TALIBAN ruled country!

Monday, February 23, 2009

A R Rahman's two Oscars ...Slumdog Milionaire

Now dream comes true!
Slumdog Millionaire bagged eight Oscars and the whole country is ecstatic about A R Rahman's two Oscars for Best Original Score and Best Original Song, which created history.
I am simply a music lover and a great fan of A.R.Rahman and so it doesn't surprise anyone that I'm so happy today that even I simply can't express my feelings when I first heard the news.
A.R.Rahman is that talent that has the potential to win more international awards in future.
But in spite of having those feelings, I have some other feelings parallelly moving in my mind.
As a closed follower of Mr. Rahman's creation, I ,based on the perception, like to tell you "JAI HO" is no where comes near the best of Rahman.
It's neither has the class of "Dil Se" -- title song nor has the melancholy of "Tuhi Re" of Bombay.
This reward might give a true international facade to him but as well as if any international music lover is trying to measure the potential of A.R.Rahman only by listening the music of "Slumdog Millionaire" will probably make a mistake.
But without any doubt, today is the historical day of Indian film industry and lets celebrate the moments without having any further critical analysis!
JAI HO !!!!

Wednesday, January 7, 2009

Best Hindi Movie of 2008 ; touched my heart

The opinion is completely mine so it might be possible that someone doesn't agree with it, but I can't help :-)
Generally I'm not the person who can be termed as an avid follower of Bollywood movies and hence prior to go to the multiplex I like to read the reviews of any movie from different sources.
When from almost all the sources, I had seen an excellent reviews about 'Rock On!..' , I decided to go to the hall to see it and I went alone :-)
Here I'm not going to elaborate the story of the movie as either people have already seen it or I like to request the people who haven't seen it yet to watch the movie. Therefore I like to write why it touches me.
'Life is a journey, not a destination ....' and like every journey in some phases we enjoyed some part of it and we don't and in some part we need to move only because of obligation. By doing this something always remain unfulfilled or unfinished and this incompleteness often pushes us to reach the next level in our life and hence sometimes it's helpful to not to build complacency factor within us.
The movie is all about that philosophy and describing that journey.
In movie a band named muzik had formed by the passion of some young guys and among them though all are passionate but when opportunity knocked one was trying to be little bit professional and other is not trying to compromise anything and persuading the same route that he used to follow. Farhan had played the first guy and Arjun Rampal acted for the second. And the remaining two guys are like that
They went to sea in a Sieve, they did,
In a Sieve they went to sea:
In spite of all their friends could say,
On a winter's morn, on a stormy day,
In a Sieve they went to sea!
But a conflict had build up between Farhan and Arjun and eventually muzik broke apart.
In future they first reunited by chance, rediscover the passion and revive the friendship.
One last time they staged a performance and after that one fo the member who suffered from cancer passed away and that's all in a very succinct manner!!!
Might be it will be another landmark movie not only by Farhan Akhtar but also by the Indian Film Industry like his 'Dil Chahta Hain'.

FEEDJIT Live Traffic Feed