problem with datatable

dxtr

Member
Joined
Oct 12, 2011
Messages
7
Programming Experience
Beginner
Hey everyone , i have this problem with datatable and it drives me crazy because as i see everything is good and it still gives me that error

526288err.jpg


i pretty sure the t11 datatable is declared with all it columns
whats the problem
please help :)
 
dxtr, it is not clear if you want a loose datarow that repeats the data scheme from your datatable (for that is the method .NewRow), or if you are trying to add a new row to datatable "Recherche.t11" and then assign its cells (one for each column from parent datatable) new values. The latter being the case, it seems you should use .Rows.Add method instead:
Dim row1 As DataRow
    row1 = Recherche.t11.Rows.Add
    row1(0) = mt.ToString

etcetera.
In any case, be sure that "row1" is declared as a type which exposes the cells, so that you can handle them with the proper syntax. Try also replacing "row1(0)" by "row1.Item(0)". I hope it helps.

VBobCat
 
Hey everyone , i have this problem with datatable and it drives me crazy because as i see everything is good and it still gives me that error

526288err.jpg


i pretty sure the t11 datatable is declared with all it columns
whats the problem
please help :)

How can you only be pretty sure? Either you're sure or you're not. If you're not then find out. The error suggests that it's not. Just before the line that throws the exception, test the Count of the Columns collection of the DataTable.
 
Back
Top