Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7076467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:18:06+00:00 2026-05-28T06:18:06+00:00

Here is my code Dim dt As DataTable = New DataTable(Intervenant) For Each column

  • 0

Here is my code

 Dim dt As DataTable = New DataTable("Intervenant")
    For Each column As DataControlField In grdvIntervenants.Columns
        dt.Columns.Add(New DataColumn(column.HeaderText))
    Next

    Dim dr As DataRow
    For Each row As GridViewRow In grdvIntervenants.Rows
        dr = dt.NewRow()
        dr.Item(0) = row.Cells(0)
        dr.Item(1) = row.Cells(1)
        dr.Item(2) = row.Cells(2)
        dr.Item(3) = row.Cells(3)
        dr.Item(4) = row.Cells(4)
        dr.Item(5) = row.Cells(5)
        dt.Rows.Add(dr)
    Next

    'add new intervenant
    dr = dt.NewRow()

    dr.Item(0) = Nom
    dr.Item(1) = Prenom
    dr.Item(2) = Courriel
    dr.Item(3) = False
    dr.Item(4) = True
    dr.Item(5) = IdIntervenant

    dt.Rows.Add(dr)


    grdvIntervenants.DataSource = dt
    grdvIntervenants.DataBind()

I am developing in ASP.NET using VB.NET as background code. I am on vs2008 with windows 7 enterprise edition (if that info is of any help)

I have just restarted doing VB.Net and my first time using a gridview without a DataBase, so maybe I am missing something. Basically, I am trying to add a DataRow (dr) to a DataTable (dt) and then put said DataTable into a Gridview (grdvIntervenants).

My first step is to take the gridview and put all its data into a DataTable. Then i create a DataRow(dr) that I populate with variables and I add said DataRow to the DataTable. After that, I put the DataTable as the DataSource and bind the GridView.

The problem is that my GridView shows the rows but they are empty.
While debugging, I found out that this error was beside all the DataRow.Item:
“In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user” Seraching for it on the net, I found out it was an issue that sometimes happens to vb users but I could nto find any solution for my problem.

I did not totally understand the error, so i tried many different ways of adding the data into the DataRow but to no avail. I also tried different way of adding the column thinking the index problem might be coming from there, but again, the problem persisted. Now, something I found weird was that the Item property of my DataRow gives the quoted error, but I see the values into the ItemArray of the DataRow.

I also found out that the same error appears beside the columns property into the dataTable.

When I try to access the data from the DataSource in my rowDatabound method using the DataBinder, it gives me null results…

So my question is: what I am missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:18:07+00:00Added an answer on May 28, 2026 at 6:18 am

    Your issue is most likely that you are using the HeaderText as the column name for the data table, but this is probably not correct.

    You should probably be testing to see if each column is a BoundField and, if so, use the BoundField.DataField as the DataTable’s column name.

    For example:

        For Each column As DataControlField In GridView1.Columns
            If TypeOf column Is BoundField Then
                dt.Columns.Add(New DataColumn(DirectCast(column, BoundField).DataField))
            End If
        Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure how to do this, here is my code Dim oWeb As New
I'm rewriting/converting some VB-Code: Dim dt As New System.Data.DataTable() Dim dr As System.Data.DataRow =
Here is my Code: Dim CompanyName, _ CompanyDomain, _ CompanyEmail, _ CompanySupportPhone Call GetEmailList
Here is my code: Dim StartString As String = Private Sub Dim EndString As
I'm having some trouble writing a query using variables. Here's my code Dim bondnumber
I have this code here: Dim MasterIndex As String()() Private Function Lookup(ByVal Search_path As
Ok the error is showing up somewhere in this here code if($error==false) { $query
Here is code from MSDN . I don't understand why the work isn't just
Here a code to demonstrate an annoying problem: class A { public: A(): m_b(1),
here is code for regular expression matching #include<iostream> #include<stdio.h> #include<string.h> using namespace std; int

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.