0

how to set connectionStrings set dynamically such as store variable?

ex: string id=root;password=sample;

<connectionStrings> 
    <add name="Myconnection" connectionString="server=localhost;user id=root;password=sample;database=sample" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
3
  • With code. This isn't code, it's a configuration setting. In your application write code that changes the user and password. Commented May 4, 2018 at 14:37
  • Possible duplicate of How to form a correct MySQL connection string? Commented May 4, 2018 at 14:40
  • Although it would probably be a LOT safer if you used only one restricted account to connect to the database and used the already available authentication, authorization, user profile mechanisms to store users, their roles and permissions. Commented May 4, 2018 at 14:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.