473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Successfully executing queries

Hi

I need to run separate insert & update queries. I suppose I can use
execute.nonquery to execute the queries. How can I tell if the queries were
successful?

Thanks

Regards
Apr 17 '06 #1
2 968
The simplest way is to check the return value of that method, and see the
number of rows affected. Alternatively, you could add some exception
throwing stuff in your SQL commands.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.ma.../13/63199.aspx
__________________________________________________ ________

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:uq**************@TK2MSFTNGP03.phx.gbl...
Hi

I need to run separate insert & update queries. I suppose I can use
execute.nonquery to execute the queries. How can I tell if the queries
were successful?

Thanks

Regards

Apr 17 '06 #2
John,

Be aware that if you do use the executenonquery to update, than you have not
the inbuild concurency checking from the dataadapter. (checking if the old
is not already changed).

Just as little warning,

Cor

"John" <Jo**@nospam.infovis.co.uk> schreef in bericht
news:uq**************@TK2MSFTNGP03.phx.gbl...
Hi

I need to run separate insert & update queries. I suppose I can use
execute.nonquery to execute the queries. How can I tell if the queries
were successful?

Thanks

Regards

Apr 17 '06 #3

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

Similar topics

8
by: MrTrix | last post by:
Hello: I'm having a problem formulating the code to execute a multiple line command. I'm trying to execute something like: set rowcount 100000 declare @rowct int select @rowct = 1 while...
7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
1
by: Job Lot | last post by:
I have written couple of queries in Access 2002 which accept parameters. How can I execute these queries in vb.net application to fill dataset object. Thanks
1
by: Job Lot | last post by:
I have written 6 Queries in an Access DB, which are executed in a For Each…Next loop to populate DataSet object. A new DataTable object is created in DataSet for each query, as follows Private...
7
by: chriskoch | last post by:
I am running a DTS Package. I have a temp table with 1494 records. I am inserting a 'Y' or 'N'into a temp table #HasClaims. The TempTable name with the Provider Id's(PRPR_ID) is...
7
by: solidsna2 | last post by:
Hi, I am new to using SQL. I want to be able to exucute a query that I place in a view. I want this views to be executed every time a value change in one of the table in a particular field. ...
8
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the...
2
by: staeri | last post by:
When I execute a stored procedure with the following code it takes forever and result in a timeout or a hang: Sub TransformData() Dim myConnection As New SqlConnection(ConnectionString) Dim...
12
by: yoavyoavyoav | last post by:
Hi , I would like a progress bar to be displayed while running an sql query. the progress bar doesn't have to move according to the query pace - I just want it to move back and forth while the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.