Creating new row in .NET Data table


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Creating new row in .NET Data table

  1. #1
    Join Date
    Oct 2005
    Posts
    95

    Creating new row in .NET Data table

    Hi

    I like to know how to create a new row in the .NET datatable . I have a save button which user will click after entering data in the datagrid . once user click on the save button a new row will generate in the data table for the information user has entered in the datagrid . The databale will save the information into the database table . How do I generate new rows in the datatable . Please show me some code

    Thanks

  2. #2
    Join Date
    Dec 2004
    Posts
    717
    // Create new DataTable and DataSource objects.
    DataTable myDataTable = new DataTable();
    // Declare DataRow variables.
    DataRow myRow;

    myRow = myDataTable.NewRow();
    myRow["id"] = 1;
    myRow["item"] = "item 001" ;
    myDataTable.Rows.Add(myRow);

    More Info:
    http://msdn.microsoft.com/library/de...ewrowtopic.asp
    Best Regards,
    Michael Sync
    http://michaelsync.net

    The more you share,The more you get

Similar Threads

  1. Updating on screen text fields with multiple table data
    By William Ed Carden in forum VB Classic
    Replies: 2
    Last Post: 10-17-2005, 06:09 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 07:46 AM
  3. ANN: MySQLDirect .NET Data Provider 1.80 has released
    By Core Lab in forum dotnet.announcements
    Replies: 0
    Last Post: 10-01-2003, 12:39 PM
  4. row level triggers
    By Ervin Rodriguez in forum Database
    Replies: 3
    Last Post: 02-07-2002, 07:21 PM
  5. Multi-row calculations
    By Bob Hines in forum Database
    Replies: 7
    Last Post: 04-27-2000, 12:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center