Question: I want to get distance text from following link. i have used NSXML parsing but unable to get the result. please tell me which xml method should i used for following xml. 

<http://maps.googleapis.com/maps/api/directions/xml?origin=30.9165904,75.8634752&destination=30.89314000,75.86938000&sensor=true>

Thanks to all

Answer: 
first: Write your code on server side on Page\_load or in any other method for selecting 
record.
and for selecting record from database you can use the following code

```
string myConnectionString="server=dbserver;database=mydatabase;uid=user;pwd=password;Connect Timeout=120;pooling=true;Max Pool Size=60;";// you can place your connection string in web.config
SqlConnection con = new SqlConnection(myConnectionString);

SqlCommand cmd = con.CreateCommand();
cmd.CommandText = @"SELECT [stuff] FROM [tableOfStuff]";

con.Open();

SqlDataReader dr = null;
try
{
    dr = cmd.ExecuteReader();

    while(dr.Read())
    {
        // construct your html for your table data here
    }
}
catch(SomeTypeOfException ex){ /* handle exception */ }

```
example aspx:

```
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
    <Columns>
        <asp:BoundField DataField="CountryID" HeaderText="ID" ItemStyle-HorizontalAlign="Center" />
        <asp:TemplateField HeaderText="Flag" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <img src='<%# "img/flags/" + Eval("CountryFlag").ToString()%>' alt="flag" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="CountryName" HeaderStyle-HorizontalAlign="Left" HeaderText="Name" ItemStyle-CssClass="dg_title"/>
        <asp:TemplateField HeaderText="VAT" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <%# CheckBool(Convert.ToBoolean(Eval("CalculateVat"))) %>
            </ItemTemplate>
        </asp:TemplateField>  
        </Columns>
</asp:GridView>

```

in the code behind the `CheckBool` is a function I have made:

```
public string CheckBool(bool toCheck)
{
    if (toCheck)
        return "<img src=\"img/checked.png\" alt=\"Yes\" />";
    else
        return "<img src=\"img/deleted.png\" alt=\"No\" />";
}

```

and in the `Page_Load`

```
protected void Page_Load(object sender, EventArgs e)
{
    GridView1.DataSource = SsUtils.GetCountries();
    GridView1.DataBind();        
}

```

`SsUtils` is a static class and the `GetCountries` returns a `List<Country>` which is a collection of the class country. But you can also use a `DataSet` or `DataTable` as datasource for your gridview.

This is just a sample, to show some possibilities. You can also have edit buttons, paging, sorting etc. with a gridview.