1

I have 1 lakh (100000) data in my database. If I try to delete content details in content_details table, I found time out error. I have list of content ids in string builder.
Error:

Timestamp: 10/29/2013 11:33:54 AM
Message: Exception thrown from:
    Thread was being aborted.
    at SNIReadSyncOverAsync(SNI_ConnWrapper* , SNI_Packet** , Int32 )
    at SNINativeMethodWrapper.SNIReadSyncOverAsync(SafeHandle pConn, IntPtr& packet, Int32 timeout)

Event code:

Sql = "DELETE FROM content_details WHERE content_id IN (select id from dbo.splitid(@content_id, ','))" 
Using con As SqlConnection = New SqlConnection(m_RequestInfo.ConnectionString) 
    Using cmd As SqlCommand = New SqlCommand(Sql, con) 
        cmd.CommandType = CommandType.Text
        con.Open()
        cmd.Parameters.Add("@content_id", SqlDbType.NVarChar).Value = contIdList.ToString()
        cmd.CommandTimeout = 600
        cmd.ExecuteNonQuery()
    End Using
End Using
4

0 回答 0