?
Solved

Can Send DataGridView Rows One Time?

Posted on 2008-06-19
3
Medium Priority
?
201 Views
Last Modified: 2012-06-22
Salam

I have a datagridview , and has many rows of data , now I want to connect to sql server table.
Can I send data one time . or I have to make For Each row in .....

0
Comment
Question by:Ahmadal_najjar2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
cpleong99 earned 2000 total points
ID: 21820659
Normally we will issue each sql insert/Update statement one time for each record.

However, if you want to improve the performance, you can issue a big SQL statement which consists of multiple Insert statement, for example:

strSQL = "Insert into tableA values (1,X,X)  " & vbcrlf & "Insert into tableA values (2,Y,Y)   "  & vbcrlf & "Insert into tableA values (3,Y,Y)"

Execute the sql Statement one time and it will insert 3 rows into the table.

However, you need to knows that you have less control on the above method, because you might fail in one of the row, but others record already inserted.

Anyway, it is really fast compare to insert 1 by 1, if you have let say 1000 lines to insert...

0
 

Author Comment

by:Ahmadal_najjar2003
ID: 21821067
It is good Idea. But As you say if I have 1000 lines. But Why Not May In the future I need it.

Thanks a lot .
0
 

Author Closing Comment

by:Ahmadal_najjar2003
ID: 31468686
Thanks A lot
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question