Temp Table and Add row and column in this table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nerurmon
    New Member
    • Jan 2008
    • 13

    Temp Table and Add row and column in this table

    Hai,
    I want to make a temp table in vs 2005. i have few field in one form and a datagridview. i want to make a temp table where i can store my different data in the controls(textbo x, combo box) data as a row of the temp table and the datasource of datagrid view will be the temp table. again when i will enter different data in the controls(textbo x, combo box) then i will press button add_data then the data will add the temp table as another row that means there will 2 row and the gridview will show this datas in two row accordingly. how can i make a temp table without database.

    please help me...
    Last edited by Plater; Feb 25 '08, 03:07 PM. Reason: removing bold
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    With the DataTable object.
    Code:
    DataTable dt = new DataTable();
    dt.Columns.Add("MyColumnName1");
    dt.Columns.Add("MyColumnName2");
    dt.Columns.Add("MyColumnName3");
    //now you have a datatable with 3 columns in it.
    Check MSDN for more information.

    Comment

    • nerurmon
      New Member
      • Jan 2008
      • 13

      #3
      Originally posted by Plater
      With the DataTable object.
      Code:
      DataTable dt = new DataTable();
      dt.Columns.Add("MyColumnName1");
      dt.Columns.Add("MyColumnName2");
      dt.Columns.Add("MyColumnName3");
      //now you have a datatable with 3 columns in it.
      Check MSDN for more information.


      Hello sir..
      This is for column purpose in a datatable but how can i add new row in this table.
      I have 3 control txt_ID, txt_Name, cmb_Group. Now i want that i will put data on three control and when i click on add item button then this data will enter into the temp data table and those control will vacant. Then i again enter new data on those three control then again there will be new row in the temp table. So please help me....

      Comment

      • nerurmon
        New Member
        • Jan 2008
        • 13

        #4
        Temp Table and Add row and column in this table

        Hai,
        I want to make a temp table in vs 2005. i have few field in one form and a datagridview. i want to make a temp table where i can store my different data in the controls(textbo x, combo box) data as a row of the temp table and the datasource of datagrid view will be the temp table. again when i will enter different data in the controls(textbo x, combo box) then i will press button add_data then the data will add the temp table as another row that means there will 2 row and the gridview will show this datas in two row accordingly. how can i make a temp table without database.

        please help me...

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Originally posted by Plater
          Check MSDN for more information.
          They have in depth explanations of how to add rows


          ALSO: Please do not double post your questions, it is against the posting guidelines.

          MODERATOR

          Comment

          Working...