Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<configuration>
  <startup>
    <supportedruntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <connectionstrings>
    <add name="SqlServerConnectionstring" connectionstring="Password=password;Connection Timeout=0;Persist Security Info=False;User ID=userid;Initial Catalog=LAH_INPUT_DATA;Data Source=servername;" />
   </connectionstrings>
</configuration>


In this code shows error that Unable to connect any of the specified mysql hosts...
we have not set any password for my sql.So how to write connection string without pwd.
Posted
Updated 29-Aug-12 4:40am
v2
Comments
Pablo Aliskevicius 29-Aug-12 10:41am    
Did you try at
http://www.connectionstrings.com/mysql
?

Hi,

Accessing your database without password is not recommended. If you do not set password in your database then there is nothing to do with login screen of your application. I suggest you to set some password to your database and update your connectionString with password. If you afraid to distribute Configuration file along with password then you can encrypt connectionString. I know your question is not to encrypt connectionString but people here try to guide you on right direction instead of giving solution for your incorrect path.

Best of luck
Thanks
-Amit Gajjar
 
Share this answer
 
If you try to connect to any database you need a password, always.

You can write a Helper class for database connections.

Hope it helps in any way.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900