Results 1 to 8 of 8

Thread: Connection string issue

  1. #1
    Join Date
    Nov 2009
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Connection string issue

    I am having trouble getting my .aspx pages to run on the server.

    The website is a .NET site that is in a folder called 'Ford' which is located within the wwwroot folder.

    It was originally bringing up an error concerning the database connection to the original database.

    Following help on the forum I found I needed a new database that was created from within the database manager in the helm, after doing this I modified the connection strings on the home page as a tester and received a new error questioning the existance of the ALUMINIUM database that I had created. I have had a further play around with the database and that error has gone but now is replaced with an application error for the website folder and is displaying issues with the page header

    "Line 5: <html xmlns="http://www.w3.org/1999/xhtml">
    Line 6: <head id="Head1" runat="server">
    Line 7: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    Line 8: <link rel="stylesheet" type="text/css" href="stylesheet.css" />"

    Any idea what is causing this and how to solve it?

  2. #2
    Join Date
    Jun 2005
    Posts
    1,080
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    Sorry, but thats not really enough information to help you out with. Let us know what the exact error says.

  3. #3
    Join Date
    Nov 2009
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The error text is below - there is a mass of information following it relating to the stack trace.

    I am not sure how to re-direct from my internal data base to the server database.

    I publish the site using Visual Studio and it was running fine when accessing the database on my PC.

    I have created a database on the server and uploaded a backup of my working database which all seems to be in order.

    Error text is:


    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 name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    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 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 name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

  4. #4
    Join Date
    Nov 2009
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think the bit I am getting wrong is the connection of the database when I publish.

    At the moment I have the following fields:

    Data source = Microsoft SQL Server (SqlClient)

    Server Name = mssql2005.aluminium.lon.periodicnetwork.com,then my port number

    Log on is set to SQL Server with the user name & password set accordingly

    Connect to a database is set to "mydatabase" for example.

    Is all the above in the correct format for this server ?

    Also in the helm there is a different connection string for internal connections - What is this for & do I need to use it ?

  5. #5
    Join Date
    Mar 2008
    Posts
    17
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    You should use the internal connection string if you're accessing the SQL server from a Red Fox hosted aspx page. The external connection string is if you want to access the SQL server from externally (ie. from a development copy of your website on your local machine, or from SQL Server Management Studio)

    Dan

  6. #6
    Join Date
    Nov 2009
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Does this mean I have to put the internal string somewhere in my scripts or config file in order to get my web pages to access the database.

    So far I have hosted and set up my database, then using visual studio I changed the web page tables to use data from the sql database from the Aluminium server.

    When I test run this in visual it works perfectly using the database off the server.

    Then I publish & upload this still using Visual and now when I try to access my home page "home.aspx" I get the following:

    If I leave all web setting as normal I get

    HTTP Error 404.3 - File or directory not found: MIME map policy prevents this request.
    Internet Information Services (IIS).

    If I set the web settings to process aspx as asp.net then I get:

    Line 35: ASP.NET to identify an incoming user.
    Line 36: -->
    Line 37: <authentication mode="Windows"/>
    Line 38: <customErrors mode="Off"/>
    Line 39: <!--

    I was advised this message was because I had not used a hosted database - but this is as far as I can tell.

    Any ideas where I am going wrong ??

  7. #7
    Join Date
    Nov 2009
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Disregard my last post - I've lost the plot - Must be getting tired.

    Ok,
    I have set up, configured and uploaded as in my last post, If I leave everything set as normal in the web site settings I get this:

    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 name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The requested address is not valid in its context.)

    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 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 name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The requested address is not valid in its context.)

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    Stack Trace:

    [SqlException (0x80131904): 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 name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The requested address is not valid in its context.)] System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +4846887 System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning(TdsParserStateObject stateObj) +194 System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4860189 System.Data.SqlClient.SqlInternalConnectionTds.Att emptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90 System.Data.SqlClient.SqlInternalConnectionTds.Log inNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +376 System.Data.SqlClient.SqlInternalConnectionTds.Ope nLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221 System.Data.SqlClient.SqlInternalConnectionTds..ct or(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189 System.Data.SqlClient.SqlConnectionFactory.CreateC onnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185 System.Data.ProviderBase.DbConnectionFactory.Creat ePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31 System.Data.ProviderBase.DbConnectionPool.CreateOb ject(DbConnection owningObject) +433 System.Data.ProviderBase.DbConnectionPool.UserCrea teRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConne ction(DbConnection owningObject) +499 System.Data.ProviderBase.DbConnectionFactory.GetCo nnection(DbConnection owningConnection) +65 System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117 System.Data.SqlClient.SqlConnection.Open() +122 System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection, ConnectionState& originalState) +31 System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +112 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92 System.Web.UI.WebControls.SqlDataSourceView.Execut eSelect(DataSourceSelectArguments arguments) +1297 System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback) +19 System.Web.UI.WebControls.DataBoundControl.Perform Select() +142 System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +73 System.Web.UI.WebControls.GridView.DataBind() +4 System.Web.UI.WebControls.BaseDataBoundControl.Ens ureDataBound() +82 System.Web.UI.WebControls.CompositeDataBoundContro l.CreateChildControls() +72 System.Web.UI.Control.EnsureChildControls() +87 System.Web.UI.Control.PreRenderRecursiveInternal() +44 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

    Seems like a disaster but I still think I am just missing how I get my tables etc to use the hosted database when running direct from www.

    Is this due to this internal connection string (which I am not using) or am I missing something more obvious ???

  8. #8
    Join Date
    Nov 2009
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Good News !!!!!,
    Sucess at last - the problem was with some settings in my config file.

    My site is now up and running apart from a couple of minor issues.

    Thanks for all the help guys.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to build my string
    By Simply_Mike in forum ASP.NET
    Replies: 4
    Last Post: 18th April 2008, 09:28 PM
  2. Strange secpay response string
    By Simply_Mike in forum Technical Support
    Replies: 5
    Last Post: 10th December 2007, 07:36 PM
  3. MySQL 5 Connection String
    By bracora.com in forum ASP.NET
    Replies: 1
    Last Post: 16th May 2006, 03:37 PM
  4. MySQL Connect String for ASP
    By holivar in forum ASP (VBScript)
    Replies: 16
    Last Post: 25th April 2006, 09:17 AM
  5. "String reference not set to " - Encrytion
    By jaimalchohan in forum ASP.NET
    Replies: 3
    Last Post: 28th November 2005, 08:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •