Wednesday, 19 December 2012

Simple ASP.NET program using Datatable

I just explain how to create data table and display item in datatable using gridview technique;

on the back end you write this code which is C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections;
using System.Data;

namespace WebApplication1
{
    public partial class gridviewsample : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGridView();
            }
        }
        private void BindGridView()
            {
            string[] array = { "pakistan", "china", "indonasia", "malaysia", "germany", "dutch", "italt" };
            DataTable dt= new DataTable();
            dt.Columns.Add("names");
            int count=0;
            for (int i = 0; i <= array.Count(); i++)
            {
                dt.Rows.Add();
                dt.Rows[i]["names"] = array[i].ToString();
                count++;
                if (count == array.Count())
                {
                    break;
                }
            }

            gvarray.DataSource = dt;
            gvarray.DataBind();
            }

    }
}
on front i.e on ASP write this one:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gridviewsample.aspx.cs" Inherits="WebApplication1.gridviewsample" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Grid view with Array list</title>
    <style type="text/css">
        gridview
        {
            font-family:Lucida Handwriting;
            font-size:10pt;
            font-weight:normal;
            color:Navy;
            width:auto;
        }
    </style>
</head>

<body>
    <form id="form1" runat="server">
    <div>
    <asp:gridview ID="gvarray" runat="server" CssClass="Gridview" AutoGenerateColumns="false" HeaderStyle-BackColor="Brown" HeaderStyle-ForeColor="White" Caption="array wise grid list">
    <Columns>
    <asp:BoundField DataField="names" HeaderText="names" /></Columns>
   
    </asp:gridview>
    </div>
    </form>
</body>
</html>

Saturday, 25 February 2012

Muneeb's Blog: what is Android?

Muneeb's Blog: what is Android?: Android is a Linux-based operating system for mobile devices such as smartphone andtablet computers. It is developed by the Open Handset ...

what is Android?


Android is a Linux-based operating system for mobile devices such as smartphone andtablet computers. It is developed by the Open Handset Alliance led by Google
Google purchased the initial developer of the software, Android Inc., in 2005. The unveiling of the Android distribution in 2007 was announced with the founding of the Open Handset Alliance, a consortium of 86 hardware, software, and telecommunication companies devoted to advancing open standards for mobile devices. Google releases the Android code as open-source, under the Apache License. The Android Open Source Project (AOSP) is tasked with the maintenance and further development of Android.
Android has a large community of developers writing applications ("apps") that extend the functionality of the devices. Developers write primarily in a customized version of Java.Apps can be downloaded from third-party sites or through online stores such as Android Market, the app store run by Google. As of October 2011 there were more than 400,000 apps available for Android, and the estimated number of applications downloaded from the Android Market as of December 2011 exceeded 10 billion.
Android was listed as the best-selling smartphone platform worldwide in Q4 2010 by Analyse with over 200 million Android devices in use by November 2011. According to Google's ANDY RUBIN, as of December 2011 there are over 700,000 Android devices activated every day.