.NETGURU
Recommended ways to process multiple row edits at the same time
Messages   Related Types
This message was discovered on ASPFriends.com 'aspng-pddwa' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Curtis Swartzentruber
Hi,

I would be especially interested in Doug's comments
on this, but any comments are welcome.

There are situations where it would be great to have
the ability to add or edit multiple rows at the same
time, rather than using the datagrid method. There
are a variety of applications where this would be
helpful. A couple of examples:

the user needs to add a group of related rows to a
one-to-many table and you want them to be able to
type the data all at once and then hit update to fire
multiple insert/update commands.

the user needs to edit all rows of an existing dataset,
for instance change the quantity on any row of a
shopping cart without explicitly hitting edit/update
in a datagrid and save all their changes with one
click.

One way you can do this is a group of textboxes, one
for each field, arranged in a table with IDs like

myQTY_01 | myDescription_01 | myFormat_01
myQTY_02 | myDescription_02 | myFormat_02

and so on. This works okay if you know upfront how
many rows you are going to need, but is less helpful
when you want complete control over how many rows
are shown, for instance in an insert scenerio. Two
ways I can think of would be putting a bunch of these
controls in the form and using visibility to turn off
the ones you don't need (which seems rather cludgy) or
programmatically adding the controls you need for the
particular situation. This last idea is one I am particularly
interested in and wondered if anyone had some sample code
ideas for this or maybe some other technique they are
using to address this issue.

Regards,

Curtis

Reply to this message...
 
    
Doug Seven (VIP)

Curtis,

This is an interesting proposal. I have an idea about using a DataGrid and
a DataSet, and adding new, empty rows to a DataTable in the DataSet, binding
the grid, with text boxes in the ItemTemplate, and using a data adapter to
reconcile the data to the database. Let me play around with it a bit
tonight.

I have to whip up an article for ASPToday.com on Web Services with
Transactions, but after that, I'm on this!
______________________________________________
doug seven | sr. developer | dotnetjunkies.com

Learn ASP.NET - Read the books...
Programming Data-Driven Web Applications with ASP.NET
http://www.amazon.com/exec/obidos/ASIN/0672321068/dotnetjunkies-20/107-10642
54-2553318

ASP.NET: Tips, Tutorials and Code
http://www.amazon.com/exec/obidos/ASIN/0672321432/dotnetjunkies-20/107-10642
54-2553318

[Original message clipped]

Reply to this message...
 
    
Madhavi Swaminathan
(Type your message here)
Hi Curtis

I am trying to to dod exactly the same thing.
I need to insert multiple rows at one time. I have one column the user needs to fill up values and once all the values are filled I need to update the values in the database. This has to be done in one transaction. I do know how many rows I need to create. It changes on the situation the user choses.
Did you get the above thing figured out?
If yes could you tell me how.
--------------------------------
From: Madhavi Swaminathan
Reply to this message...
 
 
System.Data.DataSet
System.Data.DataTable
System.Web.UI.WebControls.DataGrid
System.Windows.Forms.DataGrid




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification