CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2005_express Tags:
Item Type: NewsGroup Date Entered: 9/21/2006 6:35:24 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 1 Views: 123 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
2 Items, 1 Pages 1 |< << Go >> >|
woiks
Asp.Net User
Insert multiple rows at once into SQL table9/21/2006 6:35:24 AM

0/0

Hi All!

Can anyone share experience or give me a hint. I'm trying to figure out a fast and convinient way (for user) to insert multiple rows into SQL table. The table has two columns ID(int, pk, identity) and Val(int) - the Val should be inserted.

First I tried to use GridView. VWD generates InsertCommand, but I don't see how I can enable insert button in GridView (unlike select, delete, update buttons). Then I thought of sending MuliLine textbox values directly to db and got stuck. Finally, I remembered T-SQL 'bulk insert' command from txt or xml file but it also seems too difficult to implement in browser...

If anyone ever took such challange - please share! Thanks so much.

sbyard
Asp.Net User
Re: Insert multiple rows at once into SQL table9/21/2006 2:17:08 PM

0/0

There is no such thing as a multiple insert

Bulk insert is for getting external data into the database, and not usually used in user situations.

SQL XML can be used to perform what look like multiple inserts, bu the the underlying system still deals with a row at a time

An easy way to insert a grid of data typed in by a user is this,

You can manually or auto create create stored procedures for select/insert/update/delete - lets assume a select & insert SP's exist

Create an empty dataset

In the dataset editor, add a new table query and add the select SP - this creates a data table

Create an insert table adapter - selecting the insert SP

Save and close the dataset

In your web page load statement, when user wants to save a grid full of data

iterate the grid rows (Let's assume you have text boxes in each column/row for data entry)

for every row, add a new table row in a data table based on your dataset, adding each grid columns text box text as a field

once you have the data table filled, create a table query and use the insert method to insert the data in the data table (which it will do one row ata time for you until all rows done)

 

The great thing about the data table is that if you insert/edit/delete rows, you can simply call your table adapter, which will update changed rows, insert new, and delete the deleted rows for you


If it was easy, everybody would be doing it.
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ADO.NET 3.5 Cookbook Authors: Bill Hamilton, Pages: 980, Published: 2008
SQL Cookbook Authors: Anthony Molinaro, Pages: 595, Published: 2005
Oracle Built-in Packages Authors: Steven Feuerstein, Charles Dye, John Beresniewicz, Pages: 931, Published: 1998
Expert Oracle Database 10g Administration Authors: Sam R. Alapati, Pages: 1276, Published: 2005
The Internet Encyclopedia: P - Z Authors: Hossein Bidgoli, Pages: 976, Published: 2004
Beginning C# 2005 Databases Authors: Karli Watson, Pages: 501, Published: 2006
SQL Pocket Guide: SQL Syntax and Usage Authors: Jonathan Gennick, Pages: 184, Published: 2006
Managing and Using MySQL Authors: George Reese, Randy Jay Yarger, Tim King, Hugh E. Williams, Pages: 425, Published: 2002
SQL Server 2000 XML Distilled Authors: Kevin Williams, Bryant Likes, Andy Novick, Daryl Barnes, Pages: 634, Published: 2003

Web:
insert multiple rows into SQL table - CodingForums.com Reload this Page insert multiple rows into SQL table .... building up a SQL statement of inserts into a string, and then once you're through ...
SQL SERVER - Insert Multiple Records Using One Insert Statement ... SQL:> insert into table where some condition Supppose if i fire this Query i need to .... I need help to insert multiple rows from one table to another. ...
How to Insert Multiple Records into sql 2000 table at once ? - ASP ... How to Insert Multiple Records into sql 2000 table at once ? Last post 11-27- 2004 8:43 AM by edwardwht. 2 replies. Sort Posts: ...
Using XML To Send Multiple Rows At Once Into A Stored Procedure Using XML To Send Multiple Rows At Once Into A Stored Procedure. From time to time, people ask the question "How can I insert many records at once into SQL ...
Using ODP.NET to Insert Multiple Rows within a Single Round Trip ... Mar 21, 2005 ... Have you ever needed to insert multiple rows into a database? ... Once again I prefer PL/SQL Developer, and all future screenshots of the ...
Insert multiple rows at once - PHP I can’t get php to insert multiple > rows at once in > a MySQL database. I use the > $sql = "INSERT INTO database (a,b,c,d,e) VALUES (’$a’, ...
How can you Insert Multiple Records at once with Oracle SQL Plus ... How can you Insert Multiple Records at once with Oracle SQL Plus .... This will read from a flat text file and insert into a table. Assisted Solution ...
Google Answers: Insert multiple rows into database based on form ... Q: Insert multiple rows into database based on form data entry using PHP & mySQL .... I see that you say: if ($function=="insert") --> do the insert sql ...
Insert Multiple Records at once I want to know whether there is any way to insert into the table a set of ... on Insert Multiple Records at once within the SQL forums, ...
inserting multiple records into SQL 2k- how to?? ... me how do I insert 100 new records at once into a table in sql 2k? ... you to perform multiple inserts within a single SQL statement. ...

Videos:
An Introduction to SQLite Google TechTalks May 31, 2006 Richard Hipp ABSTRACT SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQ...
A Googly MySQL Cluster Talk Google TechTalks April 28, 2006 Stewart Smith Stewart Smith works for MySQL AB as a software engineer working on MySQL Cluster. He is an active memb...




Search This Site:










handling static html page from asp.net

help vwd setup failiure!

windowsprincipal.isinrole() returns a trust relationship error

dnn connection woes

beta2 wizard validator problem

about treeview,how to auto check all child treenodes?

sqlheper

secure cookie

need host with decent bandwidth and quick response time...

support desk 2.5 won't install on dnn 2.1.2

authentication via sessions and multiple pages in asp.net?

how to authenticate an .exe file

css layout and solpart menu problems

stuck without multiple inheritance

how to track whether a page is idle?

problem about website administration tool

custom control array property (is read only!?!)

inactive links in content page when master page has links

discussion module error--page cannot be found

using menu as site navigation

using google maps api with master pages

why aren't usernames unique to portals?

shrink sql server express database

why are there brackets around the attribute variables?

admin of ibuyspy

admin module

cache.count = 0 after adding item

help me critical error, what does this mean?

newbie: easy module navigation question

newbie question - how to create multiple parent portals with multiple domains - dnn3.1

 
All Times Are GMT