A connection was successfully established with the server, but then an error occurred - provider: TCP Provider, error: 0
Asked Answered
F

9

4

My web site was working flawless in the old Host, But now i Moved to a new host

Please pay attention: The Old host was a VPS on the same host

So i'v stoped paying him and now i'm hosting on the same host as a shared host.

So I moved all the files in to the root folder and config the SQL details in the Web.config

I can't load the site for some reason. i got Errors all the time. PLEASE HELP ME!

After I Fixed my Ajax problem.. Here ->Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0 Error

I run into another problem..

This is my Sql Server Details:

Server name : WEBSQL2K5

Server version : Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)

Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)

myLittleAdmin (for SQL Server and MSDE) v.2.7 r.118

This is the connection string

<connectionStrings>
        <add name="Con" connectionString="Data Source=localhost;Initial Catalog=DBname;user=DBusr;password=DBpass;" providerName="System.Data.SqlClient"/>
    </connectionStrings>

Server Error in '/' Application.

 A connection was successfully established with the server, but then an
 error occurred during the login process. (provider: TCP Provider,
 error: 0 - The specified network name is no longer available.)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

Source Error:

Line 25032:            this.Adapter.SelectCommand.Parameters[0].Value = ((int)(id));
Line 25033:            main_ds.TXTDataTable dataTable = new main_ds.TXTDataTable();
Line 25034:            this.Adapter.Fill(dataTable);
Line 25035:            return dataTable;
Line 25036:        }

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cf53bee4\ce0ba883\App_Code.vago_96o.15.cs Line: 25034

Stack Trace:

[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)]
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +527
   System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +359
   System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket() +88
   System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +39
   System.Data.SqlClient.TdsParserStateObject.ReadByte() +20
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +107
   System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
   System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
   System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
   System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
   System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
   System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
   System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
   System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
   System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
   System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
   System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
   System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
   System.Data.SqlClient.SqlConnection.Open() +122
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +31
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112
   System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) +162
   System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) +115
   main_dsTableAdapters.TXTTableAdapter.GetDataByID(Int32 id) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\cf53bee4\ce0ba883\App_Code.vago_96o.15.cs:25034
   _Default.InitSeo() in \\filer\sites\NV355601\www.picit.co.il\www\default.aspx.cs:36
   _Default.Page_Load(Object sender, EventArgs e) in \\filer\sites\NV355601\www.picit.co.il\www\default.aspx.cs:28
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Web.config:

<?xml version="1.0"?>
<configuration>
    <appSettings>
        <add key="SiteAddress" value="http://www.picit.co.il/" />
        <add key="SSLSiteAddress" value="https://bonsite-secure.co.il/picit/" />

        <add key="EMAIL_HOST" value="mail.barak.net.il"/>
        <add key="EMAIL_CONTACT_NAME" value="PicIt"/>
        <add key="EMAIL_USER" value="bonsite-barak.net.il"/>
        <add key="EMAIL_PASS" value="013013"/>
        <add key="MASTER_USERNAME" value="bonsite"/>
        <add key="MASTER_PASSWORD" value="master123#"/>

        <add key="FCKeditor:UserFilesPath" value="~/Up/Main/"/>
        <add key="FCKeditor:BasePath" value="~/Controls/FCKeditor/"/>
    </appSettings>
    <connectionStrings>
        <add name="Con" connectionString="Data Source=localhost;Initial Catalog=DBname;user=DBusr;password=DBpass;" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <globalization culture="he-IL" uiCulture="he-IL"/>
        <sessionState mode="InProc"/>
        <customErrors mode="Off"/>
        <identity impersonate="true"/>
        <authentication mode="Windows"/>
        <httpRuntime maxRequestLength="22000"
minFreeThreads="16"
executionTimeout="500"
useFullyQualifiedRedirectUrl="false"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="1000" />
        <pages theme="Front">
            <namespaces>
                <add namespace="Website"/>
            </namespaces>
            <controls>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagPrefix="asp"/>
                <add tagPrefix="Upload" namespace="Brettle.Web.NeatUpload" assembly="Brettle.Web.NeatUpload"/>
                <add tagPrefix="fck" namespace="FredCK.FCKeditorV2" assembly="FredCK.FCKeditorV2"/>
                <add tagPrefix="swf" tagName="movie" src="~/Controls/swf.ascx"/>
                <add tagPrefix="Btn" tagName="Friend" src="~/Controls/btn_friend.ascx"/>
                <add assembly="Bound" namespace="CustomControls" tagPrefix="asp"/>
                <add assembly="skmValidators" namespace="skmValidators" tagPrefix="Vld"/>

                <add tagPrefix="CC" tagName="Upload" src="~/Controls/upload.ascx"/>
            </controls>
        </pages>
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </assemblies>
        </compilation>
        <httpModules>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </httpModules>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
            <add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
        </httpHandlers>
    </system.web>
    <system.webServer>
        <modules>
            <add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" preCondition="managedHandler"/>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler"/>
        </modules>
        <handlers>
            <add name="ScriptResource.axd_GET" path="ScriptResource.axd" verb="GET" type="Microsoft.Web.Handlers.ScriptResourceHandler" preCondition="integratedMode,runtimeVersionv2.0"/>
            <add name="ScriptResource.axd_GET,HEAD" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
            <add name="*.asmx_*" path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv2.0"/>
        </handlers>
        <validation validateIntegratedModeConfiguration="false"/>
    </system.webServer>
</configuration>
Foreleg answered 14/10, 2011 at 1:25 Comment(2)
It's reporting an invalid network name, but I don't see where that would have been specified. Is it set in another config file that is missing? (Is it localhost? Doesn't seem likely, but you never know. Does localhost properly resolve on your host?)Recalesce
hmmm.. i don't think that there is another config file. it is a shared host.. even if i change it to 127.0.0.1 it's still shows me the same ErrorForeleg
C
1

Again you have to ask your provider to create MS-SQL database with username and password or you may create it via control panel.

Clareta answered 14/10, 2011 at 1:41 Comment(3)
they already did that. I have the DBname and the DB usr and password. and all the SQL tables are set to goForeleg
@Ofear - Then construct the new connection string with current database server.set Data Source=WEBSQL2K5 for more info on connection string visit : connectionstrings.comClareta
Your knowledge is amazing!! That works! Thanks you very much!!Foreleg
P
1

I had this problem.

It occurred because the database server had been given a second IP address. On the client it's pot luck as to which address the name resolves, and I was getting the new one.

Removing the second IP address solved the problem.

I suspect that SQL server was listening on the original address but not on the additional one.

Paige answered 3/7, 2013 at 11:2 Comment(1)
This sounds what I am having since I dont see this error all the time. Are you removing the IP Address from the SQL Server Network ConfiguationChoate
P
1

I know this is already answered, and these solutions might have worked as well, but I just ran into this problem, and after several hours of trying different suggestions from around the web - one thing worked.

  • Reset IIS app pool that my web app was using.

Sometimes going back to the basics helps!

Procter answered 20/2, 2014 at 18:33 Comment(0)
S
1

In my case, the "TCP Provider, error: 0 - The specified network name is no longer available." error was caused by a network security appliance. Once database connections originating from this server were excluded from security monitoring, this problem was resolved.

Sheldonshelduck answered 12/3, 2014 at 6:54 Comment(0)
N
0

I'd like to add, if you are using *.ini file for your system, you might want to check what server name was inputed there and make sure it is the same with what's in your web.config connection string.

Nilsanilsen answered 24/10, 2014 at 6:55 Comment(0)
N
0

I had a similar problem, but not exactly the same:

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established enter code here with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The specified data could not be decrypted.)

I followed @password in restarting the app pool, but then looked at the advanced settings and saw that 'Enable 32-bit Applications' was set to false. I changed this to true and my problem was solved. Hope this helps anyone who's tried all the other suggestions and hit a dead end.

Natator answered 3/1, 2016 at 15:50 Comment(0)
F
0

I had this problem and came across this post, i thought i would add the solution that worked for me since it isn't listed.

Updating the System.Data.SqlClient nuget package resolved the error.

Frigid answered 16/4, 2020 at 17:1 Comment(0)
H
0

I got the same error but was able to resolve it by explicitly choosing "TCP/IP" as Network Protocol while connection via SSMS

SSMS connection

Hypocoristic answered 23/4, 2020 at 17:34 Comment(0)
G
0

I had the same issue on SSRS data source pointed to the Availability group listener name showing the same error message :

The report server couldn't connect to the data source using the information you entered. Make sure you've entered the connection string and any credentials correctly.
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - The specified network name is no longer available.)

My issue was in the read only routing URL configuration. The endpoint port 5022 does not work. when I use the default port, the data source works fine.

URL configuration each replicas should be (SECONDARY_ROLE(READ_ONLY_ROUTING_URL = N'TCP://FQDN:1433')

Grory answered 28/9, 2020 at 17:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.