Dynamics CRM Report deployment for embedded connection - dynamics-crm

I am developing Dynamics CRM reports using fetchXML for my online instance. Since they need embedded connection string, my connection information is instance specific. So, for sandbox i need to deploy a specific RDL and i need to change the RDL with production connection string when deploying on prod.
I feel like i am missing something here, changing the connection string manually doesnt seem right. Please help.

You should not worry about connection string. When you deploy report to CRM your connection string is not used and overridden with environment specific connection string.

Related

How can I run my project on client pc without installing SQL server on client pc

I have developed a c# windows application which uses SQL server 2012 database in Visual Studio 2015 which is running well on my pc.
I am to install this application on a number of computers without SQL server installed on it, but when I run the application, its gives me database connection error.
My question is, how can I create the setup file to be able to run the app on those clients pc without installing SQL server on all those computers. Please I need your help.
Thank you.
Am Emmanuel.
Use an Azure database and have the clients connect to that.
Have a look at https://azure.microsoft.com/en-us/services/sql-database/
Alter your application connection string and make sure you keep the connection string secret.
Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin#myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;
An important fact is that the clients need to allow communication via port 1433.
If this is not an option create an API application and query the database via that.
If you need a private database per client you can use a database file and connect to the file
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver15
Update based on reply
You can create a pop-up on the application allowing the users to add valid settings and credentials when your appsettings.json is blank or "a test connect" to the database fails.

SQL Server 2017 Connections working in ASP.NET C# Web projects, but not in Windows projects, in Visual Studio 2019

Using the basic SqlConnection code below, I have discovered that, at my workstation, I am unable to connect to our Sql Server 2017 deployment via ASP.NET C# code in any given type of Windows-based project, such as Winforms (.NET Framework or Core) or Console apps. However, this code will run without incident in any Web-based project, such as Web Forms or MVC, either using .NET Framework or Core.
protected void testConnection()
{
string con = "Server=MySqlServer;database=MyDatabase;Integrated Security=true";
using (SqlConnection cnn = new SqlConnection(con))
{
cnn.Open();
cnn.Close();
}
}
In a web project, this code runs. In a Windows project, I get this error:
System.Data.SqlClient.SqlException: '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)'
In investigating this problem, I have tried the following:
Explicitly declaring the domain on which my SQL server is found (eg. MySqlServer.domain.com). No good.
Explicitly declaring the SQL Server port number, according to the example shown on connectionstrings.com (eg. MySqlServer, 1433). We do use the standard port number, for the record. No good.
Changing the protection level of the test method (protected/private/public). No good.
Connecting to the SQL Server in PowerShell. This connection worked.
Pinging in the SQL Server in a command prompt. The server responded in 1ms consistently.
I have asked other users on this network to test this code in a Winforms project on their workstations. No one is able to reproduce my issue.
Consulted my sysadmin. He is so far not able to find any reason why I should be having this issue.
The only difference I have noticed in all of this is that, when I declare the port number, the Inner Exception returned with the error reads "Win32Exception: A non-recoverable error occurred during a database lookup". Otherwise, it simply reads "Access is Denied."
All of this tells me that the issue is obviously something peculiar to my workstation, but I have no idea what, apart from some firewall or other local security setting that the sysadmin neglected to check. Has anyone encountered this problem?
My VS 2019 installation is only one revision out of date as of this writing, 16.8.3 as opposed to 16.8.4. I am able to connect to and run TSQL code on any database I care to via SSMS. We connect using Windows Authentication. According to the results of "select ##version", our version of SQL Server is 2017, 14.0.3356.20 (x64).
Any insight is appreciated.
We fixed it by forcing Named Pipes to be enabled in SQL Server, as opposed to using the default setting.

Connection properties pops out when starting debug the MVC Solution in VS 2015

When start the Debugging of solution using "F5" option, the connection properties pop out and ask to enter the credentials and connection properties for the database server in VS 2015 for MVC - Entity framework application.
Can some one help me to stop this pop out.
Thanks in advance.
This issue was resolved when the Connection string in the web.config is edited in the project.
In the application project I had multiple connection string information and in which I too had an connection string which has local database information and that was in the first line, when I commented that database connection string information.
I had only on actual connection string information which point to the MS SQL server database, then issue is resolved and worked fine.

Connecting iisexpress to an azure sql db which is security enabled

I created an azure sql database and started developing my web app. From Visual Studio I could debug using iisexpress and it would happily connect. But now I have turned on the "Security Enabled" feature (to require encrypted connections), the connection from iisexpress times out.
I edited the connection strings in the azure portal and the actual azure web app works fine, its just debugging with iisexpress that is broken. I've copied those exact connection strings into my web.debug.config.
Does anyone know how to get this working?
There is no need to change the connection string anymore if you set the "Security Enabled Access" to "Required". The only reason to use the security enabled connection string (the ones which looks like: .database.secure.windows.net) is if you have down level client. Only .NET 4.0 and below will require it. 4.5 will just work fine.
Please note, the security enabled connection string is not related to encryption. you need this feature if you want Auditing and Dynamic Data Masking.
Thanks,
Tomer - MSFT.

"Publish" updates connection string properly, but "Publish to Azure" does not?

I've noticed that when publishing my WebApp project to Azure Cloud Services (as a web role) with VS 2013, if I use just "Publish" (which just updates the website, and not the whole VM), it correctly updates the web.config file with the connection string specified in the publish profile. But when I use "Publish to Azure" to update the entire VM, it fails to update the connection string, and leaves it pointing to the incorrect storage account or DB.
Has anybody else observed this? Strangely it seems to be doing the right thing when I use Publish To Azure on my staging instance, but when updating the production instance it's definitely not doing what I expect it to.

Resources