Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3497132
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:20:00+00:00 2026-05-18T12:20:00+00:00

I add C# group too in this, because this is not VB problem but

  • 0

I add C# group too in this, because this is not VB problem but ExecuteNonQuery gives timeout. how to increase the time-out?

Exact errormessage: ERROR [HYT00] [Microsoft][ODBC SQL Server Driver]Timeout expired

we do have cms system and in that CMS I have created a IFRAME which calls this ASPX +VB code, which is in different physicall folder and it has managed Pipeline Classic.

When I run this in Old application it works fine. But I copied the pages to the news server and created new application pool/website Call OldASPPAGES I get ODBC timeout on ‘ExecuteNonQuery()’ function below.

Sometimes I works but 9 of the 10 cases I gettimeout. I checked the records and there are 247 records. But below you see there are 2 sql statements composed per Each loop. (update and insert)… 2 x 247 records = approx. 500 records.

But since the sql statement is concantenated so 1 call of ExecuteNonQuery, executue does do 500 SQL Statements….

I know this is GARBAGE, unacceptable…. But I inherited so for the moment I can’t rewrite that.

To the point:

Below are the original statemenst: I have just added : conn.ConnectionTimeout = 240
As you can see I’ve added 240 seconds, but I still get timeouts after approx. 30 secs… so this is not the right place….

question:
– Why does this statement work in old ASP environment (without problem) and not in this environement in an IFRAME….

  • I set timeout =240 but I still get timeout after 30 secs. Where do you set the timeout more?

Can someone advice?

thanks

 Private Function data30bis_save(ByVal data_30bis_list, ByVal user_id)
        lblMessage.Text = "data30bis_save"
        Dim conn As OdbcConnection, cmd As OdbcCommand, ra As Integer, sql As String, data_30bis As Attest30bis.Data30bisCobonet
        ' important: always purge the old situation before loading the new one !
        data30bis_cleanup(user_id)
        conn = New OdbcConnection("dsn=chris2;uid=xxx;pwd=ssddddd;")
        conn.ConnectionTimeout = 240
        conn.Open()
        sql = ""
        lblMessage.Text = "st"
        For Each data_30bis In data_30bis_list
            sql = sql & "update usr_codes set "
            If Len(data_30bis.analyseDate) > 0 Then
                sql = sql & "a30b_analysedate=convert(datetime,'" & data_30bis.analyseDate.ToString & "',103)"
            Else
                sql = sql & "a30b_analysedate=getdate()"
            End If
            sql = sql & ", a30b_errorcode=" & data_30bis.errorCode
            sql = sql & ", a30b_inputcompanyidvalid=" & Abs(CInt(data_30bis.inputCompanyIdValid))
            sql = sql & ", a30b_inputnossvalid=" & Abs(CInt(data_30bis.inputNossValid))
            sql = sql & ", a30b_noss=" & data_30bis.noss
            sql = sql & ", a30b_reservecontractorconcept=" & Abs(CInt(data_30bis.reserveContractorConcept))
            If Len(data_30bis.reserveContractorDate) > 0 Then
                sql = sql & ", a30b_reservecontractordate=convert(datetime,'" & data_30bis.reserveContractorDate.ToString & "',103)"
            Else
                sql = sql & ", a30b_reservecontractordate=getdate()"
            End If
            sql = sql & ", a30b_reservemakingconcept=" & Abs(CInt(data_30bis.reserveMakingConcept))
            If Len(data_30bis.reserveMakingDate) > 0 Then
                sql = sql & ", a30b_reservemakingdate=convert(datetime,'" & data_30bis.reserveMakingDate.ToString & "',103)"
            Else
                sql = sql & ", a30b_reservemakingdate=getdate()"
            End If
            sql = sql & ", a30b_date_modified=getdate()"
            sql = sql & " where user_id='" & user_id & "' and no_tva='" & data_30bis.companyId & "' and cd_pays_tva = 'BE'"
            sql = sql & vbCrLf
            ' 2nd SQL
            sql = sql & "insert a30b_controles (dt_ctrl, user_id, cd_pays_tva, no_tva, no_societe, a30b_analysedate, a30b_errorcode, a30b_inputcompanyidvalid, a30b_inputnossvalid, "
            sql = sql & "a30b_noss, a30b_reservecontractorconcept, a30b_reservecontractordate, a30b_reservemakingconcept, a30b_reservemakingdate, a30b_companyId) "
            sql = sql & "values (getdate(),'" & user_id & "','FR','massif',''," & "convert(datetime,'" & data_30bis.analyseDate.ToString & "',103)"
            sql = sql & "," & data_30bis.errorCode & "," & Abs(CInt(data_30bis.inputCompanyIdValid)) & "," & Abs(CInt(data_30bis.inputNossValid)) & "," & data_30bis.noss & "," & Abs(CInt(data_30bis.reserveContractorConcept))
            sql = sql & ",convert(datetime,'" & data_30bis.reserveContractorDate.ToString & "',103)," & Abs(CInt(data_30bis.reserveMakingConcept))
            sql = sql & ",convert(datetime,'" & data_30bis.reserveMakingDate.ToString & "',103)," & data_30bis.companyId & ")"
            sql = sql & vbCrLf
        Next
        lblMessage.Text = sql
        cmd = New OdbcCommand(sql, conn)
        ra = cmd.ExecuteNonQuery()
        lblMessage.Text = "ssssst"
        conn.Close()
        cmd = Nothing
        conn = Nothing
        lblMessage.Text = "ssssat"
        Return ra
    End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T12:20:01+00:00Added an answer on May 18, 2026 at 12:20 pm

    Have you tried the CommandTimeout property on the Command class yet ?

    However, that’s only symptom-fixing. Can’t you tweak your query to make it more performant ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not too new to VB.Net and the syntax, but I'm not an expert.
Add service reference to Amazon service fails, saying Could not load file or assembly
I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes
I have a strange problem creating new counters in existing group. I have a
I'm trying to get some aggregate values from different tables, but my problem is
I find numerous examples on how to add a new group to an existing
The following TSQL provides an example of how I might solve this problem with
Quick add on requirement in our project. A field in our DB to hold
I add a web reference to my wse 3.0 service in Visual Studio 2005
We add Struts errors and messages using ActionSupport.addActionError(...) and addActionMessage(...) and then output the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.