web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Report exception: "Connection State is closed. Please open the connection before executing the command." when I'm using IOrganizationService Execute() method to insert record

(0) ShareShare
ReportReport
Posted on by 455

Hi Guys,

I have a web api,  it will call  IOrganizationService Execute() method to insert records, but I encountered error: Connection State is closed. Please open the connection before executing the command, I don't really know why, sometimes it also report:"Generic SQL error." or "A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)". But the first situation is the most common. They don't come up every time. Does anybody know why that is?

I'm using Dynamics 365 OP version.

Thanks,

Stone

I have the same question (0)
  • Suggested answer
    Inogic Profile Picture
    682 on at

    Hi,

    There is a similar forum related to your query & it has the solution, please refer to this link.

    In case it does not resolve the issue, please share the source code.

    Hope this helps.

  • Stone Huang Profile Picture
    455 on at

    Hi Roohi,

    I read this post and tried it, but it doesn't work.

    I wonder if this is due to the use of CreateRequest to call the service to batch create records. I'm going to try to use service.create() to create record one by one to see if this problem still exists. Do you have any good suggestions?

    Thanks,

    Stone

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans