Last post Oct 20, 2016 07:15 AM by Chris Zhao
Oct 19, 2016 03:58 PM|acmedeepak|LINK
I am working on a my local machine with VS, C#. I am able to connect to my client VPN but if I try to connect from a connection string in my web.config file I am unable to access the same SQL server. Please guide me how to solve this issue.
My connection string is:
The values are not actual. Please tell me what I can do get things right.
I have provided my client system IP address as Data source, Database name, User name and Password(SQL authentication) in my connection string. Should I check the port or something or is it a SQL server administration issue.I don't have much experience on
SQL Admin. Please guide me the steps to solve this problem. I need to get this working tomorrow.
Please do the needful.
Oct 19, 2016 04:17 PM|PatriceSc|LINK
I am unable to access the same SQL server.
It is always best to tell what happens (exact error message or the best English translation you can) rather than just that "it doesn't work". For example here "DataSource" seems wrong to me (it would be "Data Source" and "Data Source" and "Server" are the
Knowing which error you have would liekly help to confirm if your connection string is wrong or if it is correct (maybe a typo in your post) and if instead you can't reach the db server. And again you would have another error if the db doesn't exists or
if the user is not allowed to access the db etc...
So please never post again about an error without telling which error you have.
Not direcly related but using sa is likely a bad idea (this is an administrative account that can do all tasks on the server including dropping a db, usually you try to use for your app an account that has just the needed rights). Plus if sa user is changing
his password for a safety reason, your app won't access any more etc...
So for now try perhaps :
Data Source=126.96.36.199;Password=******;User id=sa;database=Sample_APPLN
(added a blank Inside DataSource, removed the Server entry which is the same than Data Source).
Oct 20, 2016 07:15 AM|Chris Zhao|LINK
The following example is for a SQL Server database using SQL Server security (log on to the server by using user credentials in the connection string).
connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;User Id=userid; Password=password;MultipleActiveResultSets=True" />
Should I check the port or something or is it a SQL server administration issue
Connect via an IP address
connectionString="Data Source=xxx.xxx.xxx.xxx,xxxx;Initial Catalog=DatabaseName;Integrated Security=False;User Id=userid; Password=password;MultipleActiveResultSets=True" />
If it is a SQL server administration issue, you could refer the following article.