Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Write a program to show data in Gridview in ASP.NET?
    OleDbConnection x;
    OleDbDataAdapter y;
    DataSet z;
    protected void Button2_Click(object sender, EventArgs e)
    {
        x = new OleDbConnection("provider=msdaora;user id=scott;password=tiger");
        x.Open();
        y = new OleDbDataAdapter("select * from emp", x);
        z = new DataSet();
        y.Fill(z, "emp");
        GridView1.DataSource = z.Tables["emp"];
        GridView1.DataBind();  
        y.Dispose();
        x.Close(); 
    }