Friday, September 30, 2011

Monday, September 19, 2011

Conversion Between you and God

You: it’s impossible
God: All things are possible luke 18:2
You: I am too tired
God: i will give you rest mathew 11:28
You: nobody really loves me
God:i love you john 3:16
You: i can’t go on
God: y grace is sufficient 2corothians 12:9
You: i have no guidance
God:i will direct your steps psalms 32:8
You: i am afraid
God: i have not given you the spirit of fear 2timothy: 1:7
You:i feell al alone
God: i will never leave you nor forsake you hebrews 13:5
yes god is always with you

Who we are

1) Children of God ( John 1:12)
2) Sons of God (Galatians 3:26)
3) Brothers/Sisters/Mothers of Jesus Christ (Mark 3:35)
4) Light of the world (Matthew 5:14-16)
5) We are the Peacemakers (Matthew 5:9)
6) Chosen generation, a royal priesthood, a holy nation, His own special people (1 Peter 2:9, Deuteronomy 7:6, 14:2)
7) Friends of God (John 15:14)
8) Heirs of God and joint heirs with Christ (Romans 8:17)
9) The Fragrance of Christ (2 Corinthians 2:15)
10) The Righteousness of God in Him (2 Corinthians 5:21)
11) We are Saved (Ephesians 2:8)
12) The Image of God. We are created in His own image (Genesis 1:27)
13) The Temple of the living God (1 Corinthians 6:16). The temple of the Holy Spirit (1 Corinthians 6:19).
14) The Fellow citizens with the saints and members of the household of God, and dwelling place of God (Ephesians 2:19-22)
15) The Redeemed of the LORD (Isaiah 62:11-12) (Ephesians 1:7)
16) We are Christ's (1 Corinthians 3:23)
17) We are Abraham's Seed, and heirs according to the promise (Galatians 3:29)
18) We are Rich (2 Corinthians 8:9)
19) We are Strong (Hosea 3:10)
20) We are the brightness of the firmament and the Stars in the sky (Daniel 12:3)
21) We are Sanctified (Hebrews 10:10)
22) We are Blessed (Genesis 12:2) (Hebrews 6:14)
23) We are Believers in God (Psalm 56:11, 1 Peter 1:21)
24) We are Transformed (Romans 12:2)
25) We are the New Creation (2 Corinthians 5:17)
26) We are Prophets to the nations (Jeremiah 1:5)
27) We are Preachers (1 Timothy 4:2)
28) We are Anointed (Isaiah 61:1-3, Psalm 23:5, Proverbs 1:23)
29) We are His Disciples (John 8:31-32, John 15:7-8)
30) We are His witnesses (Acts 1:8)

…many more abundant blessings we have.

Saturday, September 17, 2011

Trust Is Based On Character, Not Circumstances

Years ago a military officer and his wife were aboard a ship that was caught in a raging storm at sea. Seeing his wife’s fear, the man tried to comfort her. Suddenly she grasped his sleeve and cried, "How can you be so calm?" He stepped back and drew his sword. Pointing it at her, he asked, "Are you afraid of this?" "Of course not!" she answered. "Why not?" he inquired. "Because I know you love me too much to hurt me," she said. He replied, "I also know the One who holds the winds and the waters in the hollow of His hand, and He loves us too much to fail to care for us!" Bible says in Job 13:15; Job had that same trust. He had lost his children, his wealth and his health. Even his wife had turned against him. He had only one more thing to lose—his own life. Yet Job declared that even if it were to come down to that final loss, he would continue to trust that God had a purpose in everything that happened to him.


In Job’s eyes, the important issue was not what was happening but whose hand was behind it. If God did it, Job knew he could trust it. Often our trust is based on the "what" rather than the "who." We focus on the event rather than the One who controls that event. Consequently, when trials and tribulations come crashing down upon us, our faith is shaken. We can’t understand why a loving Heavenly Father would allow such grief to enter our lives. Yet if we truly believe that He loves, we can say with Job that even though He slays us, we will believe He intends it for our good. In His infinite wisdom and goodness, He will take the most difficult circumstances and use them for our good. When you are facing life’s most severe trials, focus on the character of God. Build your trust on who God is, not on what is taking place. When you know who He is, you never have to worry about what He will allow to happen. Trust is based on character, not circumstances.

Thursday, September 15, 2011

Adding, Retrieving Name objects from a Hashtable in C#.Net

Hashtable is nothing but a collection of objects. To get brief idea,

Take a few instance of Name Class and add them to a Hashtable. Your Name will be value for Hashtable but you need to decide about key. key will unique in the Hashtable. When you are retrieving values from Hashtable this key place a major role.

First thing you need to add is namespace for Hashtable.

using System.Collections;

then take few instance of your class Name.

//Creating few instances for Class Name
Name emmu = new Name("Emmaneale", "Mendu");
Name vamshi = new Name("Vamshi", "Malyala");
Name pradeep = new Name("Pradeep", "Kandula");

We got our Values ready. So lets use initials as our key to insert into Hastable as shown below.

//Add Names into Hashtable
Hashtable SampleHashtbl = new Hashtable();
SampleHashtbl.Add("EM", emmu);
SampleHashtbl.Add("VM", vamshi);
SampleHashtbl.Add("PK", pradeep);

here if you try to use duplicates for key. You will get an error as shown in Figure 1.

 Figure 1
Done with inserting. Now lets retrieve them and display on our page.

 //Retrieve Names from Hastable
 Name ex = (Name)SampleHashtbl["EM"];   
 if (ex != null)
    Response.Write(ex.FullName + "<br/>");
 else
    Response.Write("NOT FOUND<br/>");

To retrieve we need key string. If it didn't found the key it returns null. So check before display.

That's a small example on Hashtable.

Here is the Complete Code and Output in Figure 2.

protected void Page_Load(object sender, EventArgs e)
    {
        //Creating few instances for Class Name
        Name emmu = new Name("Emmaneale", "Mendu");
        Name vamshi = new Name("Vamshi", "Malyala");
        Name pradeep = new Name("Pradeep", "Kandula");

        //Add Names into HashTable
        Hashtable SampleHashtbl = new Hashtable();
        SampleHashtbl.Add("EM", emmu);
        SampleHashtbl.Add("VM", vamshi);
        SampleHashtbl.Add("PK", pradeep);

        //Retrieve Names from HasTable
        Name ex = (Name)SampleHashtbl["EM"];   
        if (ex != null)
            Response.Write(ex.FullName + "<br/>");
        else
            Response.Write("NOT FOUND<br/>");

        ex = (Name)SampleHashtbl["VM"];
        if (ex != null)
            Response.Write(ex.FullName + "<br/>");
        else
            Response.Write("NOT FOUND<br/>");

        ex = (Name)SampleHashtbl["PK1"];
        if (ex != null)
            Response.Write(ex.FullName + "<br/>");
        else
            Response.Write("NOT FOUND<br/>");
    }

    public class Name
    {
        string FirstName;
        string LastName;

        //Constructor for our Class
        public Name(string first, string last)
        {
            FirstName = first;
            LastName = last;
        }

        //public property for FullName
        public string FullName
        {
            get
            {
                return FirstName + " " + LastName;
            }
        }
    }

 Figure 2


Emmaneale Mendu
.Net Developer

Thursday, September 8, 2011

Arrays with C# Classes

Arrays with C# Classes

Arrays works as collections of items, for instance strings. You can use them to gather items in a single group.

Here Below Example i created a Class called Name. In which we have a Two variables, A constructor expecting two inputs First and Last name. and a property that returns Full Name of a Person Name.

Its a very simple example where i am putting all Names in to an array called GroupOfFriends. Printing all Names is very easy you can use either For loop or Foreach Loop. I used Foreach.

I used WebSite page to work on this example:

.cs Code Calling Class Name from Page_Load

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;

public partial class September_Sep08 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Creating few instances for Class Name
        Name emmu = new Name("Emmaneale", "Mendu");
        Name vamshi = new Name("Vamshi", "Malyala");
        Name pradeep = new Name("Pradeep", "Kandula");

        //Creating an Array to maintain Group of Names
        Name[] GroupOfFriends = { emmu, vamshi, pradeep };

        Response.Write("List of Names in the FriendsList:<br/>");

        //Using foreach to print the Names
        foreach (Name p in GroupOfFriends)
        {
            Response.Write(p.FullName + "<br/>");
        }
    }

    public class Name
    {
        string FirstName;
        string LastName;

        //Constructor for our Class
        public Name(string first, string last)
        {
            FirstName = first;
            LastName = last;
        }

        //public property for FullName
        public string FullName
        {
            get
            {
                return FirstName + " " + LastName;
            }
        }
    }
}

Your outPut looks like below Figure

Tuesday, September 6, 2011

User Controls in ASP.NET


User Control
User Control represents the simplest form of ASP.NET control encapsualtion. Because they are the simplest, they are very easy to create and use. Mainly the grouping of existing server controls into a single control is a user control. User control code looks very similar to .aspx code as they use same html codes but this control wont have html, head tags. As you see user control takes .ascx extension whereas ASP.NET web page take .aspx, we have code behind fro user control as well .ascx.cs

Creating User Control
Creating user control is very simple in Visual Studio. To create a new user control, you first add a new user control file to your Web site. from the wesite menu, select Add New Item option(as shown Figure 1).

Figure (1)
 
After selecting Add New File dialog Box appears. Select Web User Control in templates section and in the Name Field you can assign a name with .ascx extension and click Add button buttom of the Add New Item dialog box(as Shown Figure 2).

 
Figure (2)

After adding user control in to your website it may look like this with different image(as shown in Figure 3)

 
Figure (3)

with an extension .ascx, this extension indicates that this is a user control.

As you see HTML source looks like below code
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserControl.ascx.cs" Inherits="UserControl" %>

ASP Web Page has this type of code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Sep06.aspx.cs" Inherits="practice_Sep06" %> Here user control use @Control directive rather than the @Page directive, which a web page would use. Did you notice there is no default HTML tags for User control like head, body and form. Now you can add couple of server controls to your user controls. Adding Controls to user Control Its very simple Go to Design Mode in .ascx file. drag controls from Toolbox onto your user control as your requirement, I added a Label Control and a Button Control(as shown in Figure 4).


Figure (4)

In Code Behind lets add a few steps of code before adding user control to the web page.

protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = "WelCome to My First user Control";
}

protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "You Clicked on the Button";
}

Double click on the button to get Button click event. Lets go to important part Adding user Control to web page. Adding User Control to Web Pages Its very simple Go to your web page(.aspx) in design mode drag and drop user control in a particular area as your requirement. Thats it you see the same you see on web user control design here on ASP Web Page. Try to run the web page it should look like(as shown in Figure 5).


Figure (5)

Cool Then try to click on the Button then you see the Label Text Change to "You Clicked on the Button"(as shown in Figure 6).

 
Figure (6)

If you see this then your user control is working fine. Hence, Your first user control is ready to use, you can add this user control to multiple pages as your requirement. By this way you can Html Tables to format the controls to your user controls.