470,630 Members | 1,810 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,630 developers. It's quick & easy.

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(textbox, 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(textbox, 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...
Feb 25 '08 #1
4 1626
Plater
7,872 Expert 4TB
With the DataTable object.
Expand|Select|Wrap|Line Numbers
  1. DataTable dt = new DataTable();
  2. dt.Columns.Add("MyColumnName1");
  3. dt.Columns.Add("MyColumnName2");
  4. dt.Columns.Add("MyColumnName3");
  5. //now you have a datatable with 3 columns in it.
  6.  
Check MSDN for more information.
Feb 25 '08 #2
With the DataTable object.
Expand|Select|Wrap|Line Numbers
  1. DataTable dt = new DataTable();
  2. dt.Columns.Add("MyColumnName1");
  3. dt.Columns.Add("MyColumnName2");
  4. dt.Columns.Add("MyColumnName3");
  5. //now you have a datatable with 3 columns in it.
  6.  
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....
Feb 26 '08 #3
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(textbox, 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(textbox, 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...
Feb 26 '08 #4
Plater
7,872 Expert 4TB
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
Feb 26 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Rebecca Lovelace | last post: by
6 posts views Thread by pb648174 | last post: by
reply views Thread by joe pribele | last post: by
5 posts views Thread by Timothy Perrigo | last post: by
1 post views Thread by Timothy Perrigo | last post: by
5 posts views Thread by wackyphill | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.