Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
CSS
I want to connect with MS-SQL SERVER 2008's Database from a different domain.

The ip of MS-SQL Server 2008 is: 192.168.55.33
Server Name: BDC\SQLEXPRESS
DataBase Name: DMNG
Login: sa
Password: samsung001


XML
My App.config is:
 Collapse | Copy Code
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SqlConnectionString" value="Data Source=192.168.55.33\BDC\SQLEXPRESS;Initial Catalog=DMNG;UID=sa;Password=Support2010; Integrated Security=True;"/>

  </appSettings>
</configuration>


VB
Now I am getting Exception for System.Data.SqlClient.SqlError: "A Network Related Problem" when I am trying to connect with my database.


Please help me.
Posted
Comments
CodingLover 12-Mar-14 2:29am    
Can you post the complete error message here to see?

And also, can you connect to the database remotely by using a MS SQL Management Tools?
UL UL ALBAB 12-Mar-14 3:14am    
http://www.codeproject.com/Questions/742684/Configure-ConnectionString-for-connect-from-differ

Here is the full description about my problem.

Try this, and if it is not working, let me know.
XML
<configuration>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SqlConnectionString" value="Data Source=192.168.55.33\SQLEXPRESS;Initial Catalog=DMNG;UID=sa;Password=Support2010; Integrated Security=True;"/>

  </appSettings>
</configuration>


-KR
 
Share this answer
 
Comments
UL UL ALBAB 12-Mar-14 2:51am    
No, this is not working. getting Error no: 26
In your cstring :
XML
<add key="SqlConnectionString" value="Data Source=192.168.55.33\BDC\SQLEXPRESS;Initial Catalog=DMNG;UID=sa;Password=Support2010; Integrated Security=True;"/>


Replace : Data Source=192.168.55.33\SQLEXPRESS Or Source=BDC\SQLEXPRESS

try this....

Or Check Windows Auth /Sql Server Authentication If Windows Authentication then Username and Password from Cstring
 
Share this answer
 
Comments
UL UL ALBAB 12-Mar-14 2:55am    
Windows Auth and Sql Server Authentication both have enable.
Use this n check:
Data Source=192.168.55.33\BDC\SQLEXPRESS,1433
 
Share this answer
 
Comments
UL UL ALBAB 12-Mar-14 3:03am    
TCP Provider, error:0 - No connection could be made because the target machine actively refused it.
It would be better if you try connection with SQL Server Management Studio 2008 first. Then you can add connection string like this.
C#
<configuration>
  <connectionstrings>

     <add name="ConnectionString1">
connectionString="Data Source=BDC\SQLEXPRESS;Initial Catalog=DMNG;Integrated Security=True"
providerName="System.Data.SqlClient" />

  </add></connectionstrings>
</configuration>
 
Share this answer
 
Comments
UL UL ALBAB 12-Mar-14 3:16am    
http://www.codeproject.com/Questions/742684/Configure-ConnectionString-for-connect-from-differ

here is the full description about my problem.
UL UL ALBAB 12-Mar-14 3:16am    
Can we use pipe in configuration.

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