Tuesday, January 23, 2007

Im now on my Own Blog

Now that i have coded up a simple blog on my own site, just thought to say, i will start my posts there....

Now the wanderings got a bit more freedom!

do visit it at www.kannanv.com

Friday, January 12, 2007

Sex and Spirituality

This was one of the posts I liked, posted by Deepak Chopra, the link to the original article is here - http://www.kavitachhibber.com/main/main.jsp?id=wisdom-Oct2005

I have copied the exact wordings from there to here...... Ctrl+C.....Ctrl+V

Sex and Spirituality
By Dr. Deepak Chopra, MD
(Courtesy of Dr. Deepak Chopra and Intentblog.com)
Recently I have started to write a contemporary version of the Kama Sutra. An ancient text that sees pleasure (kama) as one of the four goals of life. The other three being: Dharma which is harmony with the universe; Arth (material abundance) and Moksha (enlightenment). Before I started the book I thought I would put down any insights I personally had with you:1. Sexual energy is the primal and creative energy of the universe. All things that are alive come from sexual energy. In animals and other life forms, sexual energy expresses itself as biological creativity. In humans, sexual energy can be creative at all levels - physical, emotional and spiritual. In any situation, where we feel attraction, arousal, awakening, alertness, passion, interest, inspiration, excitement, creativity, enthusiasm, sexual energy is at work. When ever we feel these states of awareness, we must put our attention on the energy that we are experiencing, nourish it with our attention, experience it with joy and keep it alive in our awareness.
2. Sexual desire is sacred and chaste. The suppression of sexual energy is false, ugly and unchaste.
3. During sexual union, there is union between flesh and spirit.
4. Bliss, being carefree and playfulness are the essence of sex.
5. To improve your sexual experiences, get rid of your expectations.Expectations are primarily in three areas: 1) Performance, exemplified in the question, "How am I doing?" 2) Feeling, exemplified in the question, "How am I feeling?" 3) Security, exemplified in the question, "Do you love me?"
6. In sex, as in all areas of life, resistance is born of fear. All resistance is mental. It implies judgment against what is being felt. Sex becomes a problem when it gets mixed with hidden emotions such as shame, guilt and anger.
7. Sexual intimacy is the road to the taste or experience of true freedom, because it is the one area of life in which we can become completely uninhibited and free.
8. Sexual fulfillment occurs when the experience comes from playfulness instead of need. Frequently people bring their conflicts and needs into the sexual experience. When sex is used to fulfill needs, it leads to addiction. When sex comes from playfulness, the result is ecstasy. 9. All problems related to sex, neurosis, deviancy, sexual misbehavior, violence, abuse, can be traced to resistance, to suppression and repression, not to the sexual urges themselves. If we are allowed to discover our urges, desires and emotions, without outside inhibition, they won't go to extremes. Extremism, in any form, is a reaction to repression, inhibition and suppression. Aggression and violence are the shadow energies of fear and impotence.
10. Sex is a means of escaping our little self or ego. It is many peoples' only experience of meditation.
11. Meaningful sex has to be value based. Values are personal. Each situation that has sexual energy in it, involves the whole human being and their entire value system. My values may be different from yours, and I have no right to be the moral judge of anyone's values. It is important, however, to have core values, and respect them. Without values, we become spiritually bankrupt. Sexual experience will never cause problems and will always be joyful, if lovers share the same values.
12. True intimacy is union between flesh and flesh, between subtle body and subtle body, between soul and soul. Sexual energy is sacred energy. When we have restored the sexual experience to the realm of the sacred, our world will be chaste and divine, holy and healed.

Q: to Jaggi about Destiny?

Q: If everything is destined about our life, where is the scope or where is the need to use our intelligence?

Whoever told you everything is destined? Nothing is destined. It is just that unconsciously you have made yourself into a certain possibility. So, naturally, you are moving in that direction. This is not destiny; this is a blind man walking. You create certain tendencies within you with your unconsciousness, according to the tendencies you keep moving in that direction. This destiny that you are talking about is something that you created unconsciously; you can also create it consciously.

The very first moment when you utter the word spirituality, whether you realise that or not, what you are actually saying is ‘I want to take my destiny into my hands’. It doesn’t matter what my karma says. It doesn’t matter, what somebody in the heaven is going to say. ‘I want to move towards liberation.’ This is taking destiny into your hands. The moment you say ‘I want to walk a spiritual path’, you are saying ‘I want to take my destiny into my hands.’ If you want to go where you want to go, you better take your destiny into your hands; otherwise, you will exist here as an accidental being.
I know for a long time they have been telling you that God is making your destiny. Sitting there everyday and plotting your life for you. They told you many things like this but I think you are adult enough these days. They even told you your marriage was made in heaven (laughs), you believed it for three days. They have told you such things and got away with it.
There is no such thing as destiny. There is a limited sense of destiny working, there is no ultimate destiny. That is something that you have to choose. In a limited sense, the accumulations that you have within you form a certain attitude and tendency within themselves and it starts moving in that direction. It is not because somebody is guiding it in that direction. Simply because your tendencies are such, you are going that way.
Now, the river that is born on top of this mountain, at one place it’s a brook, at another place it’s a waterfall, in another place it is just a meandering river. Somewhere else, it’s become a wide estuary to join the ocean. In another place it’s become the ocean. Is this the river’s destiny? No, this is the water’s tendency. To constantly move from one place to another depending upon the levels that are there. If the oceans were placed high, the rivers wouldn’t go to the ocean.
I want you to strip yourself of all fancy stories and come to terms with life. The river is not longing to go to the ocean, although your poet said so. Water just finds its own level and keeps going, that’s all. If you dam it, the river is not sitting there and crying I want to go to the ocean. There is no such thing. It's poetry; let's enjoy the poetry, but reality is different. Enjoying poetry, enjoying the current realities around is one thing. When you are talking about reaching your ultimate reality, it’s a different thing.
Like they say in Zen; when you’re an ignorant person, rivers are just rivers; trees are just trees; mountains are just mountains; clouds are just clouds. Once you become a seeker, rivers are no more just rivers, trees are not just trees, mountains are not just mountains, clouds are not just clouds - everything has a different dimension to it. But if you reach, if you become enlightened, once again rivers are rivers, trees are trees, mountains are mountains, clouds are clouds. Then what is the point?
If you are ignorant, it is the same way, if you are enlightened it is the same way. Yes. An enlightened person is just as good as an utter fool, but completely in a different world. An enlightened person is not in any way special the way you know special, because your idea of special is adding parts to yourself. Isn’t it? Your idea of special is that you start identifying yourself with many things and become special. In that sense he is not special, he is more ordinary than the ordinary but it is a full circle. It’s a different dimension of existence all together.
Sadhguru Jaggi VasudevIsha Yoga CentreNew No.55, Moosa StreetT NagarChennai - 600 017Ph: 91-44- 24333185, 24348732

Thursday, January 11, 2007

Fate??

I am not a fatalist. I believe our lives can be as good (or as bad) as we want it. I am not very sure of the nature of the fate, that is whether it is predetermined or not. But I do assume one thing, that is it doesn’t serve anyone purpose to assume that everything in the world is predetermined. Even if our lives were pre-destined, it’s best if we assume that we are in control of our lives.

The above one was a pressing question in my mind and happened to see exactly the words that were resonating in my mind on one of my friends blog Anto.A.J....

so just posting it here...... planning to ask this question to Jaggi...

Monday, January 08, 2007

What is Love

-- By Anonymous

"If you love a person, how can you destroy his or her freedom? If you trust a person, you trust her or his freedom too.One day it happened that a man came to me who was really in a mess, very miserable. And he said, 'I will commit suicide.'I said, 'Why?'He said, 'I trusted my wife and she has betrayed me. I had trusted her absolutely and she has been in love with some other man. And I never came to know about it until just now! I have got hold of a few letters. So then I inquired, and then I insisted, and now she has confessed that she has been in love all the time. I will commit suicide' he said.I said, 'You say you trusted her?'He said, 'Yes, I trusted her and she betrayed me.'What do you mean by trust?—some wrong notion about trust; trust also seems to be political.'You trusted her so that she would not betray you. Your trust was a trick. Now you want to make her feel guilty. This is not trust.'He was very puzzled. He said, 'What do you mean by trust then, if this is not trust? I trusted her unconditionally.'I said, 'If I were in your place, trust would mean to me that I trust her freedom, and I trust her intelligence, and I trust her loving capacity. If she falls in love with somebody else, I trust that too. She is intelligent, she can choose. She is free, she can love. I trust her understanding.'What do you mean by trust? When you trust her intelligence, her understanding, her awareness, you trust it. And if she finds that she would like to move into love with somebody else, it is perfectly okay. Even if you feel pain, that is your problem; it is not her problem. And if you feel pain, that is not because of love, that is because of jealousy.What kind of trust is this, that you say it has been betrayed? My understanding of trust is that it cannot be betrayed. By its very nature, by its very definition, trust cannot be betrayed. It is impossible to betray trust. If trust can be betrayed, then it is not trust. Think over it.If I love a woman, I trust her intelligence infinitely. And, if in some moments she wants to be loving to somebody else, it is perfectly good. I have always trusted her intelligence. She must be feeling like that. She is free. She is not my other half, she is independent. And when two persons are independent individuals, only then there is love. Love can flow only between two freedoms.I have seen couples who have lived together for thirty or forty years; still, they seem to be as immature as they were on their first day together. Still the same complaint: "She doesn't understand what I am saying." Forty years being together and you have not been able to figure out some way that your wife can understand exactly what you are saying, and you can understand exactly what she is saying.But I think there is no possibility for it to happen except through meditation, because meditation gives you the qualities of silence, awareness, a patient listening, a capacity to put yourself in the other's position.It is possible with me: I am not concerned with the trivia of your life.You are here basically to listen and understand.You are here to grow spiritually.I was talking to a friend yesterday. There is a conflict between him and his wife. As is natural, he thought if he had married another woman there would not have been this state of affairs. Now this man has no experience of another woman. She exists only in imagination. The wife also feels the same way. She feels she has made a wrong choice. Another man would have made a better husband. In this case also, there is no experience of the other man. He is purely imaginary. Now we cannot have the experience of all the women in the world or all the men in the world, therefore, the illusion persists.I told my friend, "It is not a question of this woman or that woman. It is a question of your different natures. There is conflict in your dispositions. And it is the arrangement between a man and a woman that society has prescribed that is to be blamed for this, for it is an arrangement of ownership. Wherever we make permanent relationships, strife is bound to be, for the mind is most impermanent and relationships very permanent.I was traveling for twenty years in this country. I was staying in thousands of homes, and I saw it continuously: when the husband is not in the house, the wife seems to be very cheerful, very happy. The moment the husband enters the house she has a headache, and she lies down on the bed. And I was watching, because I was just staying in the house. Just a moment before, everything was okay—as if the husband has not entered but a headache has entered.Slowly slowly, I understood the logic. There is a great investment in it. And remember, I am not saying that she is simply pretending. If you pretend too long it can become a reality, it can become an autohypnosis. I'm not saying that she is not suffering from a headache, remember. She may be suffering: just the face of the husband is enough to trigger the process! It has happened so many times that now it has become an automatic process. So I am not saying that she is deceiving the husband; she is deceived by her own investments.You have a certain image and you don't want it to be changed, and criticism means again a disturbance.One of my friends was continually complaining to me about his wife; "She is always sad, long faced and I am so worried to enter the house…I try to waste my time in this club and that club but finally I have to go back home and there she is."I said to him, "Do one thing just as an experiment. Because she has been serious and she has been nagging, I cannot imagine that you enter the house smiling."He said, "Do you think I can manage that? The moment I see her something freezes inside me—smile?"I said, "Just as an experiment. Today you do one thing: take beautiful roses—it is the season; and the best ice-cream available in the city—tutti frutti; and go smiling, singing a song!"He said, "If you say so I will do it, but I don't think it is going to make any difference."I said, "I will come behind you, and see whether there is any difference or not."The poor fellow tried hard. Many times on the way he laughed. I said, "Why are you laughing?"He said, "I am laughing at what I am doing! I wanted you to tell me to divorce her and you have suggested I act as if I am going on a honeymoon!"I said, "Just imagine it is a honeymoon…but try your best."He opened the door and his wife was standing there. He smiled and then he laughed at himself because to smile…And that woman was standing almost like a stone. He presented the flowers and the ice-cream, and then I entered.The woman could not believe what was happening. When the man had gone to the bathroom she asked me, "What is the matter? He has never brought anything, he has never smiled, he has never taken me out, he has never made me feel that I am loved, that I am respected. What magic has happened?"I said, "Nothing; both of you have just been doing wrong. Now when he comes out of the bathroom you give him a good hug."She said, "A hug?"I said, "Give him one! You have given him so many things, now give him a good hug, kiss him…. "She said, "My God…. "I said, "He is your husband, you have decided to live together. Either live joyously or say goodbye joyously. There is no reason…it is such a small life. Why waste two person's lives unnecessarily?"At that very moment the man came from the bathroom. The woman hesitated a little but I pushed her, so she hugged the man and the man became so afraid he fell on the floor! He had never imagined that she was going to hug him.I had to help him up. I said, "What happened?"He said, "It's just that I have never imagined that this woman can hug and kiss—but she can! And when she smiled she looked so beautiful."Two persons living together in love should make it a point that their relationship is continuously growing, bringing more flowers every season, creating more joys. Just sitting together silently is enough….One of my friends was retiring; he was a big industrialist, and he was retiring because of my advice. I said, "You have so much and you don't have a son; you have two daughters and they are married in rich families. Now why unnecessarily bother about all kinds of worries—of business, and income tax, and this and that? You can close everything; you have enough. Even if you live one thousand years, it will do."He said, "That's true. The real problem is not the business, the real problem is I will be left alone with my wife. I can retire right now if you promise me one thing, that you will live with us.I said, "This is strange. Are you retiring or am I retiring?"He said, "That is the condition. Do you think I am interested in all these troubles? It is just to escape from my wife."The wife was a great social worker. She used to run an orphanage, a house for widows, and a hospital particularly for people who are beggars and cannot pay for their treatment. I also asked her in the evening, "Do you really enjoy all this, from the morning till the evening?"She said, "Enjoy? It is a kind of austerity, a self-imposed torture."I said, "Why should you impose this torture on yourself?" She said, "Just to avoid your friend. If we are left alone, that is the worst experience in life."And this is a love marriage, not an arranged marriage. They married each other against the whole family, the whole society, because they belonged to different religions, different castes; but their imprints gave them signals that this is the right woman, this is the right man. And all this happens unconsciously. That's why you cannot answer why you have fallen in love with a certain woman, or with a certain man. It is not a conscious decision. It has been decided by your unconscious imprint.Particularly people in India go on using women as if they are just servants. Their whole work consists of taking care of the children and the kitchen and the house, as if that's their whole life.Have you respected your wife as a human being?Then, if anger arises, it is natural. If she feels frustrated—because her life is running out and she has not known any joy, she has not known any bliss, she has not known anything that can give meaning and significance to her life….Have you just sat by her side sometimes, silently, just holding her hand, not saying a word, just feeling her, and letting her feel you? No, that is not done in India at all.Wives and husbands have only one kind of communication: quarreling. I have been acquainted with thousands of Indian families, I have stayed with thousands of Indian families. While I was traveling all over the country I was staying with so many families that I have come to know almost all kinds of families, but very rarely have I seen husbands and wives respectful to each other. Using each other, exploiting each other, reducing each other to things, but never respecting each other's divinity—then this hell is created.One of the great Hindu saints, Tulsidas, who is worshipped and read all over India by every Hindu, has a strange statement: Dhol gamar pashu aur nari. Ye sab tadan ke adhikari. He is categorizing women with drums—dhol means drum, gamar means idiots, pashu means animals, and nari means woman. All these four are constantly to be beaten. The dhol, the drum, will not work if you don't beat it. So for thousands of years Indian women have been beaten. It has been taken for granted, there is no question.I have come across situations where a husband was beating his wife and I could not tolerate it and I entered their house, and I was amazed: more than the husband, the wife was against me, saying, "He is my husband, you cannot interfere in our affairs. If he is beating me, it is perfectly okay."So deep has the conditioning gone.In Indian villages I have seen with my own eyes…In India you cannot marry a widow. It is really the same logic because if people start marrying widows then who cares about virginity? In a strange way widows look more beautiful. Perhaps they have to look more beautiful, otherwise who is going to be interested in them? Virgins are inexperienced, look childish; widows are experienced, well polished, more attractive. But in an Indian village, if you marry a widow, the whole village—which is still a tribe—boycotts you, and the boycott is total. You cannot take water from the village well, you cannot purchase anything from any village shop; nobody will welcome you into his home.The village will simply forget about you as if you don't exist. You cannot live; it is impossible. If you cannot purchase anything and nobody speaks to you, if you cannot even get water from the well, life has become impossible. What kind of freedom…?One man—he was one of my students in the University—told me that he would like to marry a widow. In India that is a problem. Nobody wants to marry a widow. So there are people who think that to marry a widow is a great sacrifice.I said, "You can marry, but once you have married she will not be a widow. Then what will you do? Then the whole charm will disappear because the charm is in her being a widow."He laughed—he thought I was joking. And he got married. And after six months he said, "You were right. I'm no more interested in her. My interest was basically in her widowhood. I wanted to show to the public that I am a great servant of people, that I am serving people even through my love. I am sacrificing my love for a widow. I am going against the society, I am going against the tradition. I am doing something great. But now the marriage has happened and the widow has come, now there is no point."I said,"You do one thing. You commit suicide. She will be a widow again, and somebody else will have a chance to serve her again. If you are really a public servant, do this." Since then I have not seen him.I am absolutely in favor of liberation—liberation for both man and woman—because it is a simple law: the enslaver also becomes a slave of his own slaves.Man has enslaved woman, but he has also become a slave. That's why you cannot find a husband who is not really henpecked—at least I have not found one yet. I have been searching for a husband who is not henpecked.Once I was on a journey and someone asked me which word in a man's vocabulary was the most valuable. My reply was, "Love". The man was surprised. He said he had expected me to answer "soul" or "God". I laughed and said, "Love is God."Raising on the ray of love one can enter the enlightened kingdom of God. It is better to say that love is God than to say that truth is God, because the harmony, the beauty, the vitality and the bliss that are part of love are not part of truth. Truth is to be known; love is to be felt as well as known. The growth and perfection of love lead to the ultimate merger with God.The greatest poverty of all is the absence of love. The man who has not developed the capacity to love lives in a private hell of his own. A man who is filled with love is in heaven. You can look at man as a wonderful and unique plant, a plant that is capable of producing both nectar and poison. If a man lives by hate he reaps a harvest of poison; if he lives by love he gathers blossoms laden with nectar.If I mold my life and live it with the well-being of all men in mind, that is love. Love results from the awareness that you are not separate, not different from anything else in existence. I am in you; you are in me. This love is religious.The doors of love only open for the person who is prepared to let his ego go. To surrender one's ego for someone else is love; to surrender one's ego for all is divine love.Love is not sexual passion. Those who mistake sex for love remain empty of love. Sex is only a passing manifestation of love. It is part of nature's mechanism, a method of procreation. Love exists on a higher plane, and as love grows, sex dissipates. The energy that has been manifested in sex is transformed into love.Love is the creative refinement of sex energy. And so, when love reaches perfection, the absence of sex automatically follows. A life of love, an abstinence from physical pleasures is called brahmacharya, and anyone who wishes to be free from sex must develop his capacity to love. Freedom from sex cannot be achieved through supression. Liberation from sex is only possible through love.I have said that love is God. This is the ultimate truth. But let me say as well that love also exists within the family unit. This is the first step on the journey to love, and the ultimate can never happen if the beginning has been absent. Love is responsible for the existence of the family and when the family unit moves apart and its members spread out into society, love increases and grows. When a man's family has finally grown to incorporate all of mankind, his love becomes one with God.Without love man is an individual, an ego. He has no family; he has no link with other people. This is gradual death. Life, on the other hand, is interrelation.Love surpasses the duality of the ego. This alone is truth. The man who thirsts for truth must first develop his capacity to love—to the point where the difference between the lover and the beloved disappears and only love remains.When the light of love is freed from the duality of lover and the beloved, when it is freed from the haze of seer and seen, when only the light of pure love shines brightly, that is freedom and liberation".

Tuesday, January 02, 2007

Italy fotos

Italy fotos posted on my site, do have a look.

Thursday, December 21, 2006

The Seven basic chakras (a bit technical)

The Seven basic chakras (http://en.wikipedia.org/wiki/Chakra)

Sahasrara

Sahasrara or the crown chakra is said to be the chakra of consciousness, the master chakra that controls all the others. Its role would be very similar to that of the pituitary gland, which secretes hormones to control the rest of the endocrine system, and also connects to the central nervous system via the hypothalamus. The thalamus is thought to have a key role in the physical basis of consciousness. Symbolised by a lotus with a thousand petals. Color violet.

Ajna

Ajna or the third eye is linked to the pineal gland. Ajna is the chakra of time and awareness and of light. The pineal gland is a light sensitive gland, that produces the hormone melatonin, which regulates the instincts of going to sleep and awakening. It has been conjectured that it also produces trace amounts of the psychedelic chemical dimethyltryptamine. Symbolised by a lotus with two petals. Color- indigo

(Note: some argue that the pineal and pituitary glands should be exchanged in their relationship to the Crown and Brow chakras, based on the description in Arthur Avalon's book on kundalini called Serpent Power or empirical research.)

Vishuddha

Vishuddha or the throat chakra is said to be related to communication and growth, growth being a form of expression. This chakra is paralleled to the thyroid, a gland that is also in the throat, and which produces thyroid hormone, responsible for growth and maturation. Symbolised by a lotus with sixteen petals. Color- blue

Anahata

Anahata or the heart chakra is related to higher emotion, compassion, love, equilibrium, and well-being. It is related to the thymus, located in the chest. This organ is part of the immune system, as well as being part of the endocrine system. It produces T cells responsible for fighting off disease, and is adversely affected by stress. Symbolised by a lotus with twelve petals. Color- Green

Manipura

Manipura or the solar plexus chakra is related to the transition from base to higher emotion, energy, assimilation and digestion, and is said to correspond to the roles played by the pancreas and the outer adrenal glands, the adrenal cortex. These play a valuable role in digestion, the conversion of food matter into energy for the body. Symbolised by a lotus with ten petals. Color- yellow

Swadhisthana

Swadhisthana or the sacral chakra is located in the groin, and is related to base emotion, sexuality and creativity. This chakra is said to correspond to the testicles or the ovaries, that produce the various sex hormones involved in the reproductive cycle, which can cause dramatic mood swings. Symbolised by a lotus with six petals. Color- Orange

[edit] Muladhara

Muladhara or the base or root chakra is related to instinct, security, survival and also to basic human potentiality. This centre is located in the region between the genitals and the anus. Although no endocrine organ is placed here, it is said to relate to the inner adrenal glands, the adrenal medulla, responsible for the fight and flight response when survival is under threat. In this region is located a muscle that controls ejaculation in the sexual act. A parallel is drawn between the sperm cell and the ovum, where the genetic code lies coiled, and the kundalini. Symbolised by a lotus with four petals. Color Red

7 chakras of the human body

The seven chakras are energy centers that dwell within us and are responsible for bringing and maintaining balance in our bodies and lives. Each of the seven centers carry out different functions. Listed below are the seven main chakras and the subsequent roles they carry out in your body and spirit.

The seventh chakra: (self knowledge, universal identity, thought) This is the greatest charka of them all, providing a bridge towards a bigger far better world. A charka linked with self consciousness that when built upon reveals improvements in wisdom, bliss and spiritual connection.

The sixth chakra: (light self, reflection ) The charka also known as a the third eye and is closely linked to your vision and intuitively sharpness, the development of this charka reveals increased mental and physical abilities that help you se life more clearly.

The fifth chakra (creative, sound, self expression) Found in the throat region, this charka is linked with creativity and art, also liked to sound and the sounds we produce, be it words or song

The fourth chakra(self acceptance, air, identity) This is a charka dedicated to the heart and it is the one in the middle, has a strong connection with love feelings and binds the mind and the body together. If developed it allows for strong true feelings and a well balanced personality

The third chakra( ego, self definition and fire) The charka that holds the key to power and it is located in the plexus. This charka has a strong link with our power over others and our body's metabolism. Keep this charka healthy and it will bring you effectiveness and energy

The second chakra( self gratification, water, emotional identity) This charka is located in the abdomen ,sexual organs and lower back, it governs sexual emotions and the element of water, connects us to other people through desire, feeling, movement. With this charka developed you will benefit from sexual performance, grace, deep feelings and willingness to change

The first chakra(self preservation , earth, physical identity) The first and basic charka and also the most important, linked to the earth element . Located in the spine, more precisely at the base of it the first chakra is the root of our survival instincts and the connection with our body and mind. Develop this charka as it will bring you presence, security, prosperity and health.

Friday, January 13, 2006

Just a discussion on what to use for reading XML....

From: Venkataramani, Kannan (Infosys) Sent: 14 December 2005 10:08To: 'Vikram Abrol'Subject: RE: Fetching XML data
Hi Vikram,

Q1. XpathDocument is a light weight class.

This means that the class does not have numerous methods and properties that consume more memory when you iniialize an instance of a class.
The object of this class are so less.

XPathDocument Class
XPathDocument Constructor
XPathDocument Constructor (Stream)
XPathDocument Constructor (String)
XPathDocument Constructor (TextReader)
XPathDocument Constructor (XmlReader)
XPathDocument Constructor (String, XmlSpace)
XPathDocument Constructor (XmlReader, XmlSpace)
Methods
XPathDocument.CreateNavigator Method

It just has one simple method and no properties as well, this is the meaning of a light weight class.

Q2. Less Footprint

When ever you try to work with XML data using different class, what happens is this, the XML document is de-serialized or read based on the type of parsing you use, during this operation, the elements are either stored as string equivalents then boxed and unboxed as and when required.
the XPathDocument has the schema information stored and the corresponding elements are stored as CLR equivalents.

So Footprint means this class trying to box and unbox variables, this requires some CPU time as well as memory, the less the memory used, less is the footprints.

In simple terms, you go to different shops to buy different items, you have more footprints than buying all items in the same shop.

Q3. Xpath and Xquery

i have a couple of links for you, these might xplain u better.
http://www.xml.com/pub/a/2002/01/02/xquery.html
http://www.db2mag.com/story/showArticle.jhtml?articleID=12803228
http://www.gnu.org/software/qexo/XQuery-Intro.html

What reader to use to read XML files.

CHOICES
PROS
CONS
XmlTextReader
-Fastest-Most efficient (memory)-Extensible
-Forward-only-Read-only-Requires manual validation
XmlValidatingReader
-Automatic validation-Run-time type info-Relatively fast & efficient(compared to DOM)
-2 to 3x slower than XmlTextReader-Forward-only-Read-only
XmlDocument (DOM)
-Full traversal -Read/write -XPath expressions
-2 to 3x slower than XmlTextReader/XmlValidatingReader-More overhead than XmlTextReader/XmlValidatingReader
XPathNavigator
-Full traversal-XPath expressions-XSLT integration-Extensible
-Read-only -Not as familiar as DOM
XPathDocument
-Faster than XmlDocument -Optimized for XPath/XSLT
-Slower than XmlTextReader

Hope this helps you
Kannan.V
[MCSD.NET]
From: Vikram Abrol [mailto:Vikram_Abrol@infosys.com] Sent: 14 December 2005 05:43To: Kannan VSubject: RE: Fetching XML data
Thanks Kannan , it helps when you say performance of one is better than another , but if this is the case then when is XmlDocument used ?
A few q: inline also..

From: Kannan V Sent: Monday, December 12, 2005 7:20 PMTo: Vikram AbrolSubject: RE: Fetching XML data

Hi Vikram,

Generally in the set of close cut answers, the most appropriate and most performance oriented one will be the choice, look below for why C is the correct answer among all others.

Use XMLReader/XMLWriter in performance oriented scenarios. Validation could be performed with XMLValidatingReader. You will pay development cost for speed.
XPathDocument is a light weight class [ What do you mean by this ? ] and the reason you want to use it is this.Reasons:1. In .NET 2.0 it becomes Read/Write.2. XPathDocument optimized for XSLT and XPath processing, has less footprint [ What do you mean by saying it has less footprint ?, resulting in much better performance relative to XmlDocument. In some cases it will perform 10 times faster, and becomes even faster in Whidbey.3. In .NET 2.0 can be used with XQueries [ Is there any diff. between Xpath & Xquery ? ].

For more information on the different methods and their performance.
----------------------------------------------------------------------
Can you explain in simple terms the below gist ?
Check this blog http://blogs.msdn.com/mfussell/archive/2004/2/23.aspx , but would appreciate how XmlReader, XmlWriter and XPathDocument classes differ in performance in concept of having xml types used as CLR type ?

XmlReader, XmlWriter and importantly the XPathDocument classes all have schema information stored. This means that when you load an XML document from a validating reader with an associated schema, we are able to store the XML types as CLR types. For example if the XML schema indicates that the values are of type xs:int these are stored as CLR int types in the XPathDocument, rather than as untyped strings. Not only does this enable you to work with the types in your CLR language of choice, but it reduces the storage and working set of the document loaded into memory, dependent your type of data of course. Importantly if you apply an XSLT or XQuery to the XPathDocument and use this to generate another XPathDocument, these CLR types are “flowed” between components in that they are not first copied to string values and then reparsed through a text XML parser. This provides a significant performance improvement when chaining XML components together that utilize schema type information.
Hope this helps...
Kannan.V
[MCSD.net]

From: Vikram AbrolPosted At: Mon 12/12/2005 16:25Posted To: ASP-ASP.NetConversation: Fetching XML dataSubject: Fetching XML data
You are creating a Web site .

You receive product lists in the form of XML documents. You are creating a procedure to extract information from these XML documents according to criteria that your users will select.
When a user makes a request, you want the results of these requests to be returned as quickly
as possible.
What should you do?


Ans C is correct…

my Question is Why D is incorrect ??


A. Create an XmlDataDocument object and load it with the XML data.
Use the DataSet property of the object to create a DataSet object.
Use a SQL SELECT statement to extract the requested data.
B. Create an XmlDataDocument object and load it with the XML data.
Use the SelectNodes method of the object to extract the requested data.
C. Create an XPathDocument object and load it with the XML data.
Call the CreateNavigator method to create an XPathNavigator object.
Call the Select method of the XPathNavigator object to run an XPath query that extracts the
requested data.
D. Create an XmlReader object.
Use the Read method of the object to stream through the XML data and to apply an XPath
expression to extract the requested data.

Thursday, January 05, 2006

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