Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Strange Issue with Plugin

Posted on by 1,695

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
    Abed Haniyah 4,285 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans