If xRs.HasRows = True Then Dim dt As New DataTable() Dim dr As DataRow = Nothing dt.Columns.Add(New DataColumn("SI", GetType(String))) dt.Columns.Add(New DataColumn("Name", GetType(String))) dt.Columns.Add(New DataColumn("Age", GetType(String))) dt.Columns.Add(New DataColumn("Sex", GetType(String))) Do While xRs.Read() RowCount = RowCount + 1 dr = dt.NewRow() dr("SI") = RowCount dr("Name") = Trim(xRs!Name) dr("Age") = Trim(xRs!Age) dr("Sex") = Trim(xRs!sex) dt.Rows.Add(dr) Loop ViewState("CurrentTable") = dt GridView01.DataSource = dt GridView01.DataBind() End If
xRs!sex
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)