-
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
-
// 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
Similar Threads
-
By William Ed Carden in forum VB Classic
Replies: 2
Last Post: 10-17-2005, 05:09 PM
-
Replies: 1
Last Post: 05-13-2005, 06:46 AM
-
By Core Lab in forum dotnet.announcements
Replies: 0
Last Post: 10-01-2003, 11:39 AM
-
By Ervin Rodriguez in forum Database
Replies: 3
Last Post: 02-07-2002, 06:21 PM
-
By Bob Hines in forum Database
Replies: 7
Last Post: 04-27-2000, 11:14 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
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
|
Bookmarks