connection problem to SQL2008

Discussion in 'Databases' started by brea245, May 19, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. followed the instructions:

    Detach the local SQL database. There are various ways to do this:
    Using VS.NET 2008/Visual Web Developer:
    Right click on the database icon in the Solution Explorer
    Select "Detach"
    -Upload the database file (.mdf) to your web site
    -Log in to the SQL 2008 section in your control panel and navigate to the SQL Tools tab
    -Select the database you want to attach the MDF file to
    -Input the path to the .mdf file. For example, \club.mdf
    -Click the "Attach Database" button

    ...but still have problem with my mdf file with proper connectionstring does not query I get error that SQL 2008 can't connect to the attached mdf. As you can see from the attached image that my author.mdf is uploaded to my web server. BTW when I upload author.mdf file my roles and memberships also post error: that it can't connect to author.mdf. I had to restore my SQL 2008 server back to original configuration for have my roles and memberships work.

    Would I need to drag mdf tables to a new default page and redo my database tables objects and try again ??
     

    Attached Files:

  2. Whats the complete error message you're getting?
     
  3. This is the error I get at query:


    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Object reference not set to an instance of an object.
    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.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

    1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

    <%@ Page Language="C#" Debug="true" %>

    or:

    2) Add the following section to the configuration file of your application:

    <configuration>
    <system.web>
    <compilation debug="true"/>
    </system.web>
    </configuration>

    Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

    Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.] DataSet1TableAdapters.StateListTableAdapter.InitConnection() +59 DataSet1TableAdapters.StateListTableAdapter.get_Connection() +15 DataSet1TableAdapters.StateListTableAdapter.InitCommandCollection() +81 DataSet1TableAdapters.StateListTableAdapter.get_CommandCollection() +15 DataSet1TableAdapters.StateListTableAdapter.GetStates() +22[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) +71 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +350 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) +488 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +95 System.Web.UI.WebControls.ListControl.PerformSelect() +34 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +18 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint


    THIS error on Debug mode :
    Server Error in '/YYtest' Application.
    --------------------------------------------------------------------------------

    Object reference not set to an instance of an object.
    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.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    Line 1556: private void InitConnection() {Line 1557: this._connection = new global::System.Data.SqlClient.SqlConnection();Line 1558: this._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["authorConnectionString"].ConnectionString;Line 1559: }Line 1560:
    Source File: c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\yytest\f9ead4cc\5baa068c\App_Code.mr5na1xd.0.cs Line: 1558
    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.] DataSet1TableAdapters.StateListTableAdapter.InitConnection() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\yytest\f9ead4cc\5baa068c\App_Code.mr5na1xd.0.cs:1558 DataSet1TableAdapters.StateListTableAdapter.get_Connection() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\yytest\f9ead4cc\5baa068c\App_Code.mr5na1xd.0.cs:1502 DataSet1TableAdapters.StateListTableAdapter.InitCommandCollection() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\yytest\f9ead4cc\5baa068c\App_Code.mr5na1xd.0.cs:1565 DataSet1TableAdapters.StateListTableAdapter.get_CommandCollection() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\yytest\f9ead4cc\5baa068c\App_Code.mr5na1xd.0.cs:1529 DataSet1TableAdapters.StateListTableAdapter.GetStates() in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\yytest\f9ead4cc\5baa068c\App_Code.mr5na1xd.0.cs:1574[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) +71 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +350 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) +488 System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247 System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +95 System.Web.UI.WebControls.ListControl.PerformSelect() +34 System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73 System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82 System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22 System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +18 System.Web.UI.Control.PreRenderRecursiveInternal() +80 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Control.PreRenderRecursiveInternal() +171 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

    Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.
     
  4. Does anyone know my connection problems???
     
  5. Hi,
    This is tough to debug here in the forums but we can offer tips.
    Are you absolutely certain all of the files and folders exist on the remote site?
    i.e. All of your App Code files.
    Salute,
    Mark
     
  6. Why pay for DASPdb if no connection?

    About to close my DASP 2008 SQL server service permanently 'cause don't see the need in having the service if it don't work. There's no phone support and the errors I get when moving, manipulating, archiving, updating database and migrating between versions is fraught with constant error.

    This is way too complex to operate.

    Half of the time my server was down due to my errors!!

    So goodbye DASP SQL ...welcome online databasing :)
     
  7. mjp

    mjp

    Good luck in the cloud!
     
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