XML connect string variable transform

Wonder if anyone has a solution for this problem.

web.config

I have this value set for connnect string value

Data Source=#{MachineName}\SQLEXPRESS;Initial Catalog=#{QiamCatalog};Integrated Security=False;User ID=uhfrfid;Password=**********;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False" providerName="System.Data.SqlClient

What I get for the connect string is the “&quot” implace of the actual inside double quote. My question is how do I format my value to get the actual double quote instead of &quote when variable is transform in web configurtion?

Hi @ggiacalone,

Thanks for reaching out with your question.

It looks like the end of the Connection String is not in the correct format: ;TrustServerCertificate=False" providerName="System.Data.SqlClient

Does the string look like this when you initially set the Value?

Data Source=#{MachineName}\SQLEXPRESS;Initial Catalog=#{QiamCatalog};Integrated Security=False;User ID=uhfrfid;Password=**********;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False;providerName=System.Data.SqlClient

If everything looks fine there, are you seeing any other errors in the logs that might help us get to the bottom of this?

Looking forward to hearing back from you.

Regards,
Garrett

Yeah Garret I don’t know very much about the connect string itself. I am grabbing what is there in our development and using variables for machine name and database name.

This is what we have in our development, and what developers use for the app they test locally.

I can do away with the quotes in the final part of that string?

TrustServerCertificate=False" providerName=“System.Data.SqlClient”

And replace it with this?

TrustServerCertificate=False;providerName=System.Data.SqlClient

image001.png

Garret thanks for your help. I think I got it. Everything from connectionString up to providerName.

Thanks for your help it worked perfectly.

image001.png

Hi @ggiacalone,

I’m glad to see changing up your connection string worked out for you.

A good resource for quick reference is: SQL Server connection strings - ConnectionStrings.com

If you have any other questions please let us know.

Regards,
Garrett

Thank you