Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

SQLCommand.ExecuteNonQuery()

Posted on 2003-03-26
8
Medium Priority
?
520 Views
Last Modified: 2008-02-20
I'm inserting a large number of rows into a SQL 2000 database. The database lives on a different machine. SQLCommand.ExecuteNonQuery() fails, but pasting the exact text of the query into query analyzer and running it there succeeds. Why might this be the case?
0
Comment
Question by:marcgale
8 Comments
 
LVL 10

Expert Comment

by:GoodJun
ID: 8211707
what error message you got?
I guess it may be due to a time out. You can try to increase the time out of the connection object (in connectionstring) and the sqlcommand object (a property) to see if it works.
0
 
LVL 4

Expert Comment

by:jppampin
ID: 8211722
what kind of sqlcommand are you using?
sql script ot stored procedure?
did you try a stored procedure?

greets, j.p.
0
 
LVL 1

Author Comment

by:marcgale
ID: 8211802
I have not adjusted the time out of the connectionstring - I'll try that. SQL not SProc.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
LVL 6

Expert Comment

by:CarlosMu
ID: 8212622
What about the user.  Does the user that you use on the Query analyzer is the user user that you use on the conection string of the program.  If not try runing that sql on the query analyser with the same user as the program
0
 
LVL 5

Accepted Solution

by:
TRUENEUTRAL earned 400 total points
ID: 8214448
Sounds like a timeout issue.  Try increasing the connection's timeout value.
0
 
LVL 1

Author Comment

by:marcgale
ID: 8214540
fails after a much shorter period of time than it takes for other queries to complete successfully. memory on the server side also does not appear to be an issue.
0
 
LVL 5

Expert Comment

by:TRUENEUTRAL
ID: 8214545
What is the error message?  what is the sql statement?
0
 
LVL 1

Author Comment

by:marcgale
ID: 8279384
I would have sworn that I'd ruled out the timeout issue. It turns out that I did not. Thanks for the help and my apologies for the belated answer acceptance.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Integration Management Part 2
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

572 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