Connecting a database built with Visual Web Developer 2008

Discussion in 'Databases' started by Featheriver, Jan 9, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I confess I'm not very knowledgeable about connecting a database built with Visual Web Developer 2008, and I'm failing miserably in following the KB article 010369 about "How to connect to SQL Server 2005 using SQL Server Management Studio?"

    I've been all over the books I have, this forum, and the MSDN library trying everything I can to make the connection without success.

    Following is the error message I get.

    Can anyone explain simply what I need to do to make the connection? Help would be greatly appreciated.

    ===================================
    Cannot connect to sql2k511.discountasp.net.
    ===================================
    Login failed for user 'ncdccnet000'. (.Net SqlClient Data Provider)
    ------------------------------
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
    ------------------------------
    Server Name: sql2k511.discountasp.net
    Error Number: 18456
    Severity: 14
    State: 1
    Line Number: 65536

    ------------------------------
    Program Location:
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
    at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
    at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
    at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
    at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
    at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.ValidateConnection(UIConnectionInfo ci, IServerType server)
    at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.Connect
     
  2. JorgeR

    JorgeR DiscountASP.NET Staff

    it seems that you are using the account user name and not the SQL login for your account


    junior

    DiscountASP.NET

    www.DiscountASP.NET
     
  3. Well, I'm sort of lost.


    I do understand I'm erroneously using my account name for the login.


    My web.config file reads as follows:


    <connectionStrings>


    <add name="Data Source=tcp:sql2k511.discountasp.net;Initial Catalog=SQL2005_584267_ppdatabase;User ID=SQL2005_584267_ppdatabase_user;Password=*****;" />


    </connectionStrings>


    If I understand correctly the entry of "User ID=SQL2005_584267_ppdatabase_user;" is my SQL login. (I have used *** in place of my password, here.)


    None the less when I try to access the website via Internet Explorer I get the following error:



    Server Error in '/' Application.


    Configuration Error


    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Required attribute 'connectionString' not found.

    Source Error:





    Code:
    Line 26: 	</appSettings>
    Line 27: 	<connectionStrings>
    Line 28: 		<add name="Data Source=tcp:sql2k511.discountasp.net;Initial Catalog=SQL2005_584267_ppdatabase;User ID=SQL2005_584267_ppdatabase_user;Password=maggierambo;" />
    Line 29: 	</connectionStrings>
    Line 30: 	<system.web>
    Source File: E:\web\ncdccnet000\htdocs\web.config Line: 28






    Version Information:Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053


    I'm still missing something in all this. Can you steer me in the right direction?


    A many thanks for your help.<!--
    [ConfigurationErrorsException]: Required attribute 'connectionString' not found. (E:\web\ncdccnet000\htdocs\web.config line 28)
    at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
    at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
    at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
    at System.Configuration.BaseConfigurationRecord.GetSection(String configKey, Boolean getLkg, Boolean checkPermission)
    at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
    at System.Web.HttpContext.GetSection(String sectionName)
    at System.Web.Configuration.HttpConfigurationSystem.GetSection(String sectionName)
    at System.Web.Configuration.HttpConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String configKey)
    at System.Configuration.ConfigurationManager.GetSection(String sectionName)
    at System.Configuration.ConfigurationManager.get_ConnectionStrings()
    at ToDoDataSetTableAdapters.ToDoTableAdapter.InitConnection() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\997df263\eefbfd68\App_Code.z_8qj3rr.1.cs:line 722
    at ToDoDataSetTableAdapters.ToDoTableAdapter.get_Connection() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\997df263\eefbfd68\App_Code.z_8qj3rr.1.cs:line 658
    at ToDoDataSetTableAdapters.ToDoTableAdapter.InitAdapter() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\997df263\eefbfd68\App_Code.z_8qj3rr.1.cs:line 712
    at ToDoDataSetTableAdapters.ToDoTableAdapter.get_Adapter() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\997df263\eefbfd68\App_Code.z_8qj3rr.1.cs:line 648
    at ToDoDataSetTableAdapters.ToDoTableAdapter.GetToDoByStatus(Nullable`1 IsComplete) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\997df263\eefbfd68\App_Code.z_8qj3rr.1.cs:line 773
    [TargetInvocationException]: Exception has been thrown by the target of an invocation.
    at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
    at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
    at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
    at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
    at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
    at System.Web.UI.WebControls.GridView.DataBind()
    at System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound()
    at System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls()
    at System.Web.UI.Control.EnsureChildControls()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Control.PreRenderRecursiveInternal()
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    at System.Web.UI.Page.ProcessRequest()
    at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
    at System.Web.UI.Page.ProcessRequest(HttpContext context)
    at ASP.default_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\997df263\eefbfd68\App_Web_42zajwzp.0.cs:line 0
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    --><!--
    This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments.-->
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page