Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
XML
<?xml version="1.0" encoding="utf-8" ?>

<configuration>
  <configSections>
  </configSections>
  <appSettings>
    <!--   User application and configured property settings go here.-->
    <!--   Example: <add key="settingName" value="settingValue"/> -->
    <add key="SqlConnectionString" value="Data Source=MINTU\SQLEXPRESS\SQLEXPRESS;Initial Catalog=EmiInventory;Integrated Security=False;user=sa;password=database"/>

  </appSettings>

  <system.net>
    <mailSettings>
      <smtp deliveryMethod="PickupDirectoryFromIis">
        <network defaultCredentials="true" host="localhost" port="587"/>
      </smtp>
    </mailSettings>
  </system.net>
</configuration> 


This is my config file. I am connected with a PC by LAN and the name of the PC is 'MINTU' and there is MS SQL Server 2005' name is 'MINTU\SQLEXPRESS' Thus why my connection string is :
HTML
<add key="SqlConnectionString" value="Data Source=MINTU\SQLEXPRESS\SQLEXPRESS;Initial Catalog=EmiInventory;Integrated Security=False;user=sa;password=database"/>


I am getting error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance is correct and the SQL Server is configured to allow remote connections.

But, I have already enabled remote and local connection on that PC and in my PC from SQL Server Surface Area Configuration. So, please help me if you have any solution.
Thank you.
Posted
Comments
psychic6000 11-Nov-12 8:37am    
express edition sucks... i had the same problem once... couldnt find anything to connect remotely...

 
Share this answer
 
v2
C#
<add key="SqlConnectionString" value="Data Source=MINTU\SQLEXPRESS\SQLEXPRESS;Initial Catalog=EmiInventory;Integrated Security=False;user=sa;password=database" />

change your connectionstring. your datasource is wrong. MINTU\SQLEXPRESS\SQLEXPRESS reemove one of this SQLEXPRESS and use this
C#
<add key="SqlConnectionString" value="Data Source=MINTU\SQLEXPRESS;Initial Catalog=EmiInventory;Integrated Security=False;user=sa;password=database" />
 
Share this answer
 
Comments
UL UL ALBAB 11-Nov-12 5:28am    
I had already used that. But, this not working.

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