hello friends
I am trying to convert a vb.net datagridview code into asp.net. I want to display last three rows of table column from database table in gridview column1.

         Dim dt As New DataTable

        ' Create columns
        dt.Columns.Add("column1", Type.GetType("System.String"))
        dt.Columns.Add("column2", Type.GetType("System.String"))
        dt.Columns.Add("column3", Type.GetType("System.String"))
        dt.Columns("column3").Expression = "[column1]+[column2]"
        dt.Rows.Add("", "")
        dt.Rows.Add("", "")
        dt.Rows.Add("", "")
        dt.Rows.Add("", "")

        Me.GridView1.DataSource = dt


    I know how to display table data in gridview using the code below

   Dim con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\dtb.accdb")
        Dim Query2 As String = "select * from table1"
        Dim Da As OleDbDataAdapter, Ds As New DataSet, Dtb As New System.Data.DataTable
        Da = New OleDbDataAdapter(Query2, con)
        Dtb = Ds.Tables(0)
        GridView1.DataSource = Dtb

the gridview shows in web form but I cannot make any input in gridview cell,also how to bind last three rows in column1. can someone please help me with this


depending on how youb process the rows. Assuming you loop them all through
when update button is clicked. You could just iterate

For Each row As GridViewRow in GridView1.Rows

Dim cbDelete As CheckBox = DirectCast(row.FindControl("CheckBox1"),

' Accessing text in first Cell
Dim strText As String = row.Cells(0).Text