#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Montreal, Canada
    Posts
    486
    Rep Power
    12

    Dynamic Table ??


    Is it me or that doesn't exist anymore or what ?

    I need to use pointers or what in .Net ?

    I created a new table

    dim table() as integer

    then when I try to do

    table.add(blah blah blah)

    the .add doesn't exist and I don,t see wich option I could use to add a new element.

    the only thing my be createdinstance but I doubt that's the way and then how does it work.

    it's just really stupid, but I can't find information about it in my book or on the net ! I feel pretty dumb this week.


    I am using an ArrayList cause I didn't find information about a Dynamic Table. but is that ok ? and is that normal that it doesn't exist anymore ?
    Last edited by Watever; October 1st, 2003 at 11:38 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Portugal
    Posts
    106
    Rep Power
    12
    I don't know if I understood you right but you can create a DataTable like this:

    Code:
    DataTable myDataTable = new DataTable();
    
    DataColumn myDataColumn;
     
    // Create new DataColumn, set DataType, ColumnName and add to DataTable.    
    myDataColumn = new DataColumn();
    myDataColumn.DataType = System.Type.GetType("System.Int32");
    myDataColumn.ColumnName = "perguntaID";
    myDataColumn.ReadOnly = false;
    myDataColumn.Unique = false;
    // Add the column to the table.
    myDataTable.Columns.Add(myDataColumn);
     
    // Create second column.
    myDataColumn = new DataColumn();
    myDataColumn.DataType = System.Type.GetType("System.Int32");
    myDataColumn.ColumnName = "resID";
    myDataColumn.ReadOnly = false;
    myDataColumn.Unique = false;
    // Add the column to the table.
    myDataTable.Columns.Add(myDataColumn);
    
    DataRow myDataRow;
    myDataRow = myDataTable.NewRow();
    
    myDataRow["perguntaID"] = 10;
    myDataRow["resID"] = 150;
    myDataTable.Rows.Add(myDataRow);
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Montreal, Canada
    Posts
    486
    Rep Power
    12
    Yeah but creating a datarow is just too much ! That's not something I was talking !

    in Visual Basic, microsoft create a table that was name Dynamic. That table was replacing the pointers etc.. in C and C++

    cause you were able to create a table of 0 element, then you could to table.add(myelement) and then you got 1 element in it. then you do the samething again and have 2 element.

    in C++ you were just refering your pointer to the other one.

    but in VB before that was not possible cause you didn't got any pointers. Soo you needed to declare a table of exemple 10 elements but if wanted to add 11 then you got a problem.

    but looks like VB.Net just delete that option because now you have arraylist etc... all others possibilities to use. Or maybe it's just because .net is at his first version.

IMN logo majestic logo threadwatch logo seochat tools logo