Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0 C#3.0 C# ASP.NET C#4.0
<?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 :
<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 10-Nov-12 21:36pm
Comments
psychic6000 at 11-Nov-12 8:37am
   
express edition sucks... i had the same problem once... couldnt find anything to connect remotely...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<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
<add key="SqlConnectionString" value="Data Source=MINTU\SQLEXPRESS;Initial Catalog=EmiInventory;Integrated Security=False;user=sa;password=database" />
  Permalink  
Comments
UL UL ALBAB at 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)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 11 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100