Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2003, 11:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hello,

The Edit Command Column is for editing, though, not for new records. It's possible you could add a dummy row of data to the data source and then edit that... I found another solution at: http://www.dotnetjohn.com/articles/articleid27.aspx. However, whenever I add a row of data, and add it back to the data table, the ID field in the data table (which is defined as an Identity in SQL Server) is not incremented (it is zero in command window). This is before I call an Update statement for the data adapter. Now, I think what may be happening, is because I haven't called the update statement, it isn't updating the ID number. I just wanted to confirm that what I'm stating is the fact. Is this true?

Thanks.

Thanks.
 
Old December 18th, 2003, 12:59 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This is correct. Unless you run an INSERT to SQL you won't get a new identity value. Because you are working with a disconnected dataset, you can add rows to the datatable but you'll need to provide every bit of information for the columns.

I think your best approach is to follow the advice in the article and create a separate input form for new entries.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 18th, 2003, 05:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I had decided to separate the Add functionality.

Thanks for your assistance.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Scrollbar in row of Datagrid Except Header Row Theone84 ASP.NET 2.0 Professional 0 August 11th, 2008 12:10 AM
Adding another row using footer in DataGrid liduwan ASP.NET 1.0 and 1.1 Basics 0 January 16th, 2005 11:18 AM
Manage data row by row in datagrid Dragonist Classic ASP Databases 5 July 29th, 2004 04:17 AM
Adding a button to each row of a datagrid badgolfer ASP.NET 1.0 and 1.1 Basics 1 March 1st, 2004 10:05 AM
Dynamically adding a row to a DataGrid vwindrow ASP.NET 1.x and 2.0 Application Design 2 August 20th, 2003 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.