Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Strange Issue with Plugin

(0) ShareShare
ReportReport
Posted on by 1,703

Windows 2016 (VM)  - CRM 2016 OnPremisis

Windows 2016(VM) - SQL2014

I don't know where to start with this one!

After previous problems on my dev system with accessing reports, I ended up trashing the CRM and SQL and rebuilding them. Both built fine and I could access all areas of the 'default' CRM.

I imported the organization from the old dev CRM ( CRM2016) and tested all areas - all ok.

Now this is where I'm going around in circles. I have tried to apply a plugin which uses TSQL to query the organization database. This plugin was working fine on the 'trashed' CRM, and all I have done is point the datasource to the current datasource. This is the frustrating part.  CRM can see and use the organization database, however when the plugin tries to make a connection I get ;

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I have tried the following;

1. All firewalls are down

2.Used the sa user for the connection

3. checked the SQL server is available (sqlcmd -L ) .. and its present.

4. Named Pipes and TCP/IP are enabled

5 SQL Logs don't appear to be showing any errors

My Plugin code

Dim SLQConnection As New SqlClient.SqlConnection("Data Source=xxxSQL;Initial Catalog=CRMProcessing;Persist Security Info=True;User ID=sa;password=xxxxxxxxx")

Dim SQLCommand As New SqlClient.SqlCommand

Dim SQLReader As SqlClient.SqlDataReader

Dim ReportNo As String = UCase(eentity.Attributes("new_bacsreportsid").ToString)

SQLCommand.CommandType = CommandType.StoredProcedure

SQLCommand.CommandText = "CRM_ARUDDProcessing_FM"

SQLCommand.Connection = SLQConnection

SLQConnection.Open()

SQLCommand.Parameters.Add("@PREXMLText", SqlDbType.VarChar).Value = Replace(XMLFile, "encoding =""utf-16""", "")

 SQLReader = SQLCommand.ExecuteReader

I'm at a complete loss as where to look now. any assistance would be gratefully received ..I'm on my second day trying to work this out. Not sure if its a CRM or SQL issue.

*This post is locked for comments

  • Suggested answer
    Abed Haniyah Profile Picture
    4,287 on at

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans