DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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, 05:09 PM
  2. Java vs. .Net. A questionnaire
    By Basil in forum .NET
    Replies: 1
    Last Post: 05-13-2005, 06: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, 11:39 AM
  4. row level triggers
    By Ervin Rodriguez in forum Database
    Replies: 3
    Last Post: 02-07-2002, 06:21 PM
  5. Multi-row calculations
    By Bob Hines in forum Database
    Replies: 7
    Last Post: 04-27-2000, 11:14 AM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links