473,493 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

vb.net and sql2000

I run a vb.net application and store info into a datatable while processing.
I end up with a few hundred records when finished. After processing is
finished I need to take the records and update them into the sql DB.

Currently I loop through the datatable and insert one record at a time using
the sqlcommand ExecuteNonQuery(). Is there a better way?

All the reocords are new records so none of them will need updating. Once
the record is inserted into my datatable it is in its final form to be
inserted into my DB table. It's also at this point that I begin any
database connection steps needed.

Thanks for any suggestions

Nov 20 '05 #1
3 939
* "Brian Shannon" <bs******@lbrspec.com> scripsit:
I run a vb.net application and store info into a datatable while processing.
I end up with a few hundred records when finished. After processing is
finished I need to take the records and update them into the sql DB.


For data(base) related questions, give this group a try:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
"Brian Shannon" <bs******@lbrspec.com> wrote in
news:ug**************@TK2MSFTNGP12.phx.gbl:
Currently I loop through the datatable and insert one record at a time
using the sqlcommand ExecuteNonQuery(). Is there a better way?


You could call a .Update from the DataAdapter. Or you could use a
Dataset... I think a Dataset has a .Update method too.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #3
Hi Brian,

When there cannot be a concurrency problem (you are sure that the primary
key of records does not exist) than you have in my opinion now the best
solution.

The dataset does exactly the same, however has of course more overhead.

I hope this helps?

Cor
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1240
by: John | last post by:
Hi All, If I want to deploy an C#+SQL2000 application to client site, does the client computer need to have SQL2000 server at all ? or the relevant database and tables will be collected during...
1
2175
by: Anote Sangkunakupt | last post by:
I have created a virtual cube in SQL2000. Then, I have generated a Calculated Member. When I did rollup into a higher level, SQL2000 did re-calculate the member. However, I want to summerize the...
1
3326
by: LizP | last post by:
Hi, guys - looking for a bit of help/advice on moving a database from SQL 7 to SQL 2000. We've a third party application which currently uses a SQL7 database. This database has a number of views...
2
1396
by: Ger Eielts | last post by:
Hi all, I am brandnew with SQL2000, so sorry in advance for stupidities.... SQL2000, SP3, running on a SBS2003-server with WindowsSharePoint Services. I want to make a dataconnection (from...
6
2120
by: David Waz... | last post by:
Moved an app from W/2000 Asp V1.0 to W/2003, VS/2003, ASPV 1.1 Page runs a long job, uploading 2 large fixed length files (300,000 rows) into SQL database. A process is run against the data,...
2
1532
by: bk | last post by:
This is driving me crazy. I get "SQL Server is unavailable or does not exist" error while developing asp.net application in vs2003's IDE development mode but when I install the application on the...
12
1326
by: Robert Bravery | last post by:
HI all, I downloaded vbexpress and am trying to connect to my sql 2000 server, but keep on getting this error messag: "An error occured while establishing a conenction to the server. When...
2
1669
by: PointMan | last post by:
i make a project in vs2005 that use ASPNETDB.MDF and use <asp:LoginView ID="LoginView1" runat="server" > server control for vs2005 in this case , i'd like to use hosting service but this...
0
1696
by: basuritta | last post by:
I am trying to add a SQL2000 subscriptor to a SQL2005 publisher and distributor using the Management Studio. I'm using a non-standard port in both ends, but I have set the port for the TCP/IP...
7
3498
by: jc | last post by:
Hello, a question for the MS Access community, from someone who programs with SQL in SQL2000. I currently create a table with varying column names and data within SQL2000. I then need to...
0
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.