Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase.ExecuteNonQuery does not return
    primarykey
    data
    text
    <p>I have a very odd issue. When I execute a specific database stored procedure from C# using SqlCommand.ExecuteNonQuery, my stored procedure is never executed.</p> <p>Furthermore, SQL Profiler does not register the command at all. I do not receive a command timeout, and no exeception is thrown.</p> <p>The weirdest thing is that this code has worked fine over 1,200,000 times, but for this one particular file I am inserting into the database, it just hangs forever.</p> <p>When I kill the application, I receive this error in the event log of the database server: <code>"A fatal error occurued while reading the input stream from the network. The session will be terminated (input error: 64, output error: 0).</code> Which makes me think that the database server is receiving the command, though SQL Profiler says otherwise.</p> <p>I know that the appropiate permissions are set, and that the connection string is right as this piece of code and stored procedure works fine with other files.</p> <p>Below is the code that calls the stored procedure, it may be important to note that the file I am trying to insert is 33.5MB, but I have added more than 10,000 files larger than 500MB, so I do not think the size is the issue:</p> <pre><code>using (SqlConnection sqlconn = new SqlConnection(ConfigurationManager.ConnectionStrings["TheDatabase"].ConnectionString)) using (SqlCommand command = sqlconn.CreateCommand()) { command.CommandText = "Add_File"; command.CommandType = CommandType.StoredProcedure; command.CommandTimeout = 30 //should timeout in 30 seconds, but doesn't... command.Parameters.AddWithValue("@ID", ID).SqlDbType = SqlDbType.BigInt; command.Parameters.AddWithValue("@BinaryData", byteArr).SqlDbType = SqlDbType.VarBinary; command.Parameters.AddWithValue("@FileName", fileName).SqlDbType = SqlDbType.VarChar; sqlconn.Open(); command.ExecuteNonQuery(); } </code></pre> <p>There is no firewall between the server making the call and the database server, and the windows firewalls have been disabled to troubleshoot this issue.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload