如何通过它的IP地址远程检索来自我的SQL Server的数据 [英] how to retrive data from my sql server through its ip address remotly

查看:78
本文介绍了如何通过它的IP地址远程检索来自我的SQL Server的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<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>



在此代码中显示了无法连接任何指定的mysql主机的错误...
我们尚未为我的sql设置任何密码.因此,如何在不使用pwd的情况下编写连接字符串.



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.

推荐答案



不建议不使用密码访问数据库.如果未在数据库中设置密码,则与应用程序的登录屏幕无关.我建议您为数据库设置一些密码,并使用密码更新您的connectionString.如果您害怕与密码一起分发配置文件,则可以加密connectionString.我知道您的问题不是对connectionString进行加密,但是这里的人们试图引导您朝着正确的方向发展,而不是为错误的路径提供解决方案.

祝你好运
谢谢
-Amit Gajjar
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


如果您尝试连接到任何数据库,则始终需要密码.

您可以编写用于数据库连接的Helper类.

希望它能以任何方式提供帮助.
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.


这篇关于如何通过它的IP地址远程检索来自我的SQL Server的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆