?
Solved

SQLCommand.ExecuteNonQuery()

Posted on 2003-03-26
8
Medium Priority
?
518 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
[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
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
Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

 
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
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