p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 (http://p2p.wrox.com/forumdisplay.php?f=229)
-   -   How to dump TextBox values to a database (http://p2p.wrox.com/showthread.php?t=59624)

cJeffreywang July 1st, 2007 09:29 AM

How to dump TextBox values to a database
 
Where can I find from this book the information on
how to dump the TextBox values to a database?

TIA,
Jeffrey

Imar July 1st, 2007 09:50 AM

In the standard version of the book there are two chapters devoted to this: Data Binding in ASP.NET 2.0 and Data Management in ADO.NET.

I assume the Special Edition has the same or similar chapters.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

cJeffreywang July 2nd, 2007 01:57 PM

Thanks.

I reviewed these two chapters quickly again. If I understand correctly, the initial aspx pages in these two chpaters are based on the database schema, e.g. GridView, then the users edit or update the database directly. I am wondering if I can prepare a web page with some text boxes for end users, who know nothing about the database, to provide their desired information only, then the submitted aspx file can update/insert these online data to the database.

TIA,
Jeffrey

Imar July 2nd, 2007 02:03 PM

Quote:

quote:who know nothing about the database
How do you see this?

Are you talking about dynamic SQL that adapts to what users enter? Or do you as a page developer know the schema?

The Data Management with ADO.NET chapter shows how to manually write code to update a database using objects like the SqlConnection, SqlCommand and parameters.

If this isn't what you're after, can you please elaborate?

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

cJeffreywang July 3rd, 2007 11:19 AM

Yes, let me elaborate my question.

As an example, I have 4 tables: Voucher, Vendor, Request, and Received, and I want to prepare a web page with some 20+ textboxes
and labels. After the users fill the textboxes and click submit
button, I'd like the aspx page populate the users' textboxes values to my 4 tables, respectively.

Instead of using GridView, DetailsView, etc. of VS 2005 to display each table to a user, is there a new server control or format tool to link a textbox value to a specific database table. I know in VS 2003, we can write codes-behind to populate the tables. My question is: in VS 2005 we need the same coding, or ASP.NET 2.0 has a better tool to accomplish these tasks quickly for users who know nothing about the database tables?

TIA,
Jeffrey

Imar July 3rd, 2007 01:27 PM

Users usually don't know about the database structure. The GridView and other databound controls and any home grown solutions (should) all shield the user from technical details.

If the GridView, DetailsView etc don't fit your solution, I think you need to write your own code using the objects I mentioned earlier.

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

cJeffreywang July 3rd, 2007 10:10 PM

Thanks.

One more question. If I create some database Views, I should be able to use GridView, DetailsView, etc. to dump user's data to the Views.
Am I right?

TIA,
Jeffrey

Imar July 4th, 2007 12:43 AM

It depends. Some views are updateable, others aren't. This depends on the underlying queries of the views.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.


All times are GMT -4. The time now is 09:11 PM.

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