locked
Trying to connect and set up database using 1and1.com RRS feed

  • Question

  • User943969478 posted

    Here is my conncetion string for 1and1.  I am styarting over; I have 2 MS SQL databases that I can use but I am lost and want to use this personal web kit. 

    Here is the connection string they give:

    Current connection string :

     Provider=sqloledb;Data Source=mssql07.1and1.com,1433;Initial Catalog=dbxxxxxxx;User Id=dbo2xxxxxxxx;Password=*****;  

     

    Here is how they say I need to connect to my MS SQL DB

    <%@ Page Language="VB" %>
    <script runat="server">
       
        Sub Page_Data
        Dim oDR as System.Data.SQLClient.SQLDataReader
            Dim oCom As System.Data.SQLClient.SqlCommand
            Dim oConn as System.Data.SQLClient.SQLConnection
            try
                oConn = New System.Data.SQLClient.SQLConnection ("server=mssqlxxx.1and1.com; initial catalog=dbxxxxxxxxx;uid=dboxxxxxxxxx;pwd=xxxxxxxx")
    oConn.Open()
    oCom = New System.Data.SQLClient.SqlCommand()
    oCom.Connection = oConn
    oCom.CommandText = "SELECT * FROM products"
    oDR = oCom.ExecuteReader()
    While oDR.Read
        Response.Write(oDR.Item("id") & ", " & oDR.Item("price"))
        Response.Write("<BR/>")
        End While
            catch
                Response.Write("Error:" & err.Description)
            Finally
            oDR = Nothing
            oCom = Nothing
            oConn.Close()
            oConn = Nothing
            end try
        End Sub
    </script>
    <html>
    <title>Queries from the MS-SQL database with ASP.NET</title>
    <body bgcolor="FFFFFF">
    <h2>Query from table <b>products</b> with ASP.NET</h2>
    <%Page_Data()%>
    </body>
    </html>

    HELP PLEASE .   

    Friday, August 31, 2007 8:37 PM

All replies

  • User595806616 posted

    What error are you getting?

    Friday, August 31, 2007 11:00 PM
  • User943969478 posted

     

    I started from scratch again;  I have been with 1and1 for a few years just using HTMLwith no problems.  I have the deveolper package: there has to be a way to make this work.

     When I log into my online access to my MS SQL it hace a conncetion string of: Provider=sqloledb;Data Source=mssqlXX.1and1.com,1433;Initial Catalog=db21XXXXXXXX;User Id=dbo2153XXXXX;Password=*****;

     Thanks for looking at it.

     

    Russ

    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)

    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: 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)

    Source Error:

    Line 194:			Using command As New SqlCommand("GetNonEmptyAlbums", connection)
    Line 195:				command.CommandType = CommandType.StoredProcedure
    Line 196:				connection.Open()
    Line 197:				Dim list As New Generic.List(Of Album)()
    Line 198:				Using reader As SqlDataReader = command.ExecuteReader

    Source File: E:\kunden\homepages\43\d103481118\App_Code\PhotoManager.vb    Line: 196

    Stack Trace:

    [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) +734931
       System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
       System.Data.SqlClient.TdsParser.Connect(Boolean& useFailoverPartner, Boolean& failoverDemandDone, String host, String failoverPartner, String protocol, SqlInternalConnectionTds connHandler, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject, Boolean aliasLookup) +820
       System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +628
       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
       PhotoManager.GetRandomAlbumID() in E:\kunden\homepages\43\d103481118\App_Code\PhotoManager.vb:196
       PhotoManager.GetPhotos() in E:\kunden\homepages\43\d103481118\App_Code\PhotoManager.vb:93
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
       System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +296
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
       System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +482
       System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +2040
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17
       System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
       System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
       System.Web.UI.WebControls.FormView.DataBind() +4
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
       System.Web.UI.WebControls.FormView.EnsureDataBound() +163
       System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69
       System.Web.UI.Control.EnsureChildControls() +87
       System.Web.UI.Control.PreRenderRecursiveInternal() +41
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
     
    Config.web

    <?xml version="1.0"?>

    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

    <connectionStrings>

    <remove name="LocalSqlServer" />

    <add name="Personal" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf" providerName="System.Data.SqlClient"/>

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf"/>

    </connectionStrings>

    <system.web>

    <pages styleSheetTheme="Black"/>

    <customErrors mode="Off"/>

    <compilation debug="true"/>

    <authentication mode="Forms">

    <forms loginUrl="Default.aspx" protection="Validation" timeout="300"/>

    </authentication>

    <authorization>

    <allow users="*"/>

    </authorization>

    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

    <roleManager enabled="true"/>

    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">

    <providers>

    <add name="XmlSiteMapProvider" description="SiteMap provider which reads in .sitemap XML files." type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap" securityTrimmingEnabled="true"/>

    </providers>

    </siteMap>

    </system.web>

    <location path="Admin">

    <system.web>

    <authorization>

    <allow roles="Administrators"/>

    <deny users="*"/>

    </authorization>

    </system.web>

    </location>

    </configuration>

    Friday, August 31, 2007 11:21 PM
  • User-1217278391 posted

    Hi,

    in the UK 1and1 do not allow web pages running/executing locally (ie on yr PC) to access MS SQL on their server.  what is required is that you load yr page up to the live server and test it there.

    for development purposes have 2 web.config files with two seperate connection strings. 1 that connects to your local MSSQL and one that connects to the one in yr hosting package.

    hope this helps, let me know.

    matt a

     

    Monday, October 1, 2007 11:38 AM
  • User-192685231 posted

     Did you get this working rgkimball?

    Thursday, October 4, 2007 1:38 AM
  • User-353612631 posted

    Dear rgkimball,

     

     I am using 1and1 as well and I am having the same issue.

     

    How did you resolve your?

     

    Thanks

     

    Flaubert

    Saturday, November 17, 2007 1:13 PM
  • User-353612631 posted

    Matt,

     

    Please help me,

     

    this the web.config file that comes with the personal web kit,

     

    please guide me step by step on what to change in the config file to make this work.

     

    <?xml version="1.0"?>

    <configuration>

    <connectionStrings>

    <add name="Personal" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf" providerName="System.Data.SqlClient" />

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" />

    </connectionStrings>

    <system.web>

    <pages styleSheetTheme="White"/>

    <customErrors mode="RemoteOnly"/>

    <compilation debug="false"/>

    <authentication mode="Forms">

    <forms loginUrl="Default.aspx" protection="Validation" timeout="300" />

    </authentication>

    <authorization>

    <allow users="*"/>

    </authorization>

    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

    <roleManager enabled="true"/>

    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">

    <providers>

    <add name="XmlSiteMapProvider"

    description="SiteMap provider which reads in .sitemap XML files."

    type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

    siteMapFile="web.sitemap"

    securityTrimmingEnabled="true"/>

    </providers>

    </siteMap>

    </system.web>

    <location path="Admin">

    <system.web>

    <authorization>

    <allow roles="Administrators"/>

    <deny users="*"/>

    </authorization>

    </system.web> </location>

    </configuration>

    Saturday, November 17, 2007 1:40 PM
  • User-353612631 posted

    Matt,

     

    Please help me,

     

    this the web.config file that comes with the personal web kit,

     

    please guide me step by step on what to change in the config file to make this work.

     

    <?xml version="1.0"?>

    <configuration>

    <connectionStrings>

    <add name="Personal" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|Personal.mdf" providerName="System.Data.SqlClient" />

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|aspnetdb.mdf" />

    </connectionStrings>

    <system.web>

    <pages styleSheetTheme="White"/>

    <customErrors mode="RemoteOnly"/>

    <compilation debug="false"/>

    <authentication mode="Forms">

    <forms loginUrl="Default.aspx" protection="Validation" timeout="300" />

    </authentication>

    <authorization>

    <allow users="*"/>

    </authorization>

    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>

    <roleManager enabled="true"/>

    <siteMap defaultProvider="XmlSiteMapProvider" enabled="true">

    <providers>

    <add name="XmlSiteMapProvider"

    description="SiteMap provider which reads in .sitemap XML files."

    type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

    siteMapFile="web.sitemap"

    securityTrimmingEnabled="true"/>

    </providers>

    </siteMap>

    </system.web>

    <location path="Admin">

    <system.web>

    <authorization>

    <allow roles="Administrators"/>

    <deny users="*"/>

    </authorization>

    </system.web> </location>

    </configuration>

    Saturday, November 17, 2007 1:40 PM
  • User1292734557 posted

    Hi,

    I have a business account with 1and1 and I've been trying to setup the same website template but I've been experiencing the same problem.  I spoke with a Customer Support rep, who told me that they do not support SQL Express.  The being the case, I'm going to try delpoying to a SQL Server 2005 database instead. Also, we'll have to modify the the connection string by replacing the |DataDirectory| with the path provided by 1and1. 

     Mike

    Wednesday, November 28, 2007 5:07 PM