Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 22, 2009 04:51 AM by Taju
Sep 08, 2007 05:04 AM|LINK
Line 16: Dim myConnection As New SqlConnection(strConnString)Line 17: Line 18: myConnection.Open()Line 19: Line 20: Dim myTrans=myConnection.BeginTransaction()
[SqlException (0x80131904): An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +685966 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +109 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +383 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +170 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +130 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 _Default.Button1_Click(Object sender, EventArgs e) in E:\inetpub\vhosts\httpdocs\Default.aspx.vb:18 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +174 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102
Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832
Sep 08, 2007 07:23 AM|LINK
Make sure your connection string is correct.
Sep 10, 2007 12:07 AM|LINK
i can conect to the database in my local machine with no problem:
myCommand.Connection = myConnection
myCommand.Transaction = myTrans
sClientEmail = TextBox2.text
iRegionID = 0
iRegionID = TextBox1.Text
Sep 10, 2007 12:13 AM|LINK
from my webhost:
"For security purposes, we don't allow SQL server remote connection."
how will i be able to connect, edit and save to my database if this is the case?
Sep 10, 2007 10:32 AM|LINK
That's strange. I assume they must be having a clustered server. I do not see any specific security reasons.
They seem to be nervous about opening port 1433. Can you connect to the remote sql server using your Sql Server Management Studio? Just drop a mail to them to enquire about this.
Sep 10, 2007 11:46 PM|LINK
how to connect using Sql Server Management Studio? what will i place in the server name? never tried connecting it to the internet before. I already emailed them about it and that's their response :(
Sep 11, 2007 02:43 AM|LINK
Connect to database engine using Management Studio is very easy. You can fill in the server IP in the sever name filed (if you don't have a managemnet studio installed, click here to download:
However, i don't think it can solve you problem since if the server side doesn't allow remote connection, you will not be able to connect to the server using management studio neither.
Hope my suggestion helps
Sep 11, 2007 05:12 PM|LINK
Remote connections need to be allowed. I wonder how would the others be connecting to the db hosted by your webhosting co.
Sep 13, 2007 12:25 AM|LINK
i just phoned my webhost. they told me that their sql server 2005 is ok. it is not sql 2005 express but a licensed sql 2005. other client can connect to them with no problem. i asked them to provide me with sample connectionstring but they told me that
they cannot provide me with a sample and will give me links to tutorials instead.
could you help me on this guys?
could you give me a substitute connectionstring or a sample that will be able to connect to a licensed sql server? i could try every combination of connectionstring all day.
if i uploaded already my database to my website is it considered remote connection if somebody visit my website and connect(like order something and his orders will be save in my database) to my database using my site?
got this email from my webhost:
We've already looked into your problem and it seems that the error occurs due to your connection string. This problem is on your side already and we can't provide you that string since we're just your host. Please consider searching sites that offers tutorial
or forums with regards to sql 2005 configuration.
Sep 13, 2007 02:16 AM|LINK
Attachdbfilename can ONLY be used in sql express not sql 2005. So you cannot use attachdbfilename in your connection string in your case.
Try the connection string below
<add name="your connection string name" connectionString="Data Source=SERVER IP;Initial Catalog="Your CONNECT DB NAME";User ID=Your USER NAME;Password=YOUR PSW;"