none
Unable to access SQL

    Question

  • Hi,

     Keep getting this error when I BUILD the application,

    Error      1             An error occurred while establishing a connection to SQL Server instance '.\SQLEXPRESS'.

    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)           C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets        157        10

    Monday, August 01, 2011 3:17 AM

Answers

  • Tim, Robert and Yann,

     

    I finally got everything installed in the correct sequence and I am back in business.

    SQLEXPRWT_x64_ENU never would download.


    1. SQLEXPR_x64_ENU.exe  installed great
    2. VSLS2011_ENU  I prefer this over vs_vslsweb because it was already downloaded.
    3. SQLManagementStudio_x64_ENU selected to install common features  (this gives a message that it is incompatible with WIN7, but the fix is to download and install SQLEXPR_x64_ENU and that is already installed)

    To verify I:

    • launched SQL Server Management Studio and restored a backup of my data base (don't forget your backups)
    • created a new project from scratch and added a simple table and listanddetail screen, F5 = AWESOMENESS
    • opened my existing app, updated the datasource, F5 = AWESOMENESS

    No Red X's to be found.

     

    Thanks again,

    Mark

    Wednesday, August 10, 2011 8:47 PM

All replies

  • Have you opened the ApplicationDatabase.mdf file in anything else, like Visual Studio Server Explorer?

    I think this is the error that I get when I forget to close the connection after I've been looking ata data in the tables through VS.


    Yann

    (plus ça change, plus c'est la même chose!)

    Monday, August 01, 2011 5:10 AM
    Moderator
  • You need that the SQL Express service is running on your machine.

     

    Andreas

    Monday, August 01, 2011 5:13 AM
  • I have not opened this sql iwith any other program but LS. It is a new installation of LS.

    Thanks for the assistance.

    Ralph

    Monday, August 01, 2011 8:28 PM
  • Just to expand on Andreas answer, is the SQL Express service running on your machine?

    In other words, if you go to Control Panel > Administrative Tools > Services, can you see a service called 'SQL Server (SQLEXPRESS)' and is the service running?

    Tim

    Monday, August 01, 2011 8:43 PM
  • Just check and it is not running, tried to start it and got an Error 14001 It has side-by-side configuration which is incorrect. I will see what that is all about.

    Thanks a lot, I really appricate it.

    Ralph

    Monday, August 01, 2011 10:45 PM
  • Hi Tim,

    Just check and it is not running, tried to start it and got an Error 14001 It has side-by-side configuration which is incorrect. I deleted LS including SQL and reinstall/fix the program ...still does not work. Any suggestiobs?

    Thanks a lot, I really appricate it.

    Ralph

    Wednesday, August 03, 2011 9:08 PM
  • Hi Ralph,

    I wish I knew the answer to this but hopefully someone else here might be able to suggest how to resolve a 14001 error.

    Good luck!

    Tim

    Wednesday, August 03, 2011 9:43 PM
  • It is just an attempt:

    - deinstall lightswitch

    - go to MS Website, download and install SQL Server 2008 Express (http://www.microsoft.com/download/en/details.aspx?id=26729)

    - try to connect to SQL Server Express e.g. with SQL Server Management Studio (http://www.microsoft.com/download/en/details.aspx?id=22985)

    - install lightswitch again (the install process should recognize the existing SQL Srv)

    good luck! ;-)

    Andreas


    Thursday, August 04, 2011 5:26 AM
  • I have seen many postings regarding this 14001 SQL error (from non Lightswitch users in other forums) and have not seen any responses that had an absolute fix. 

    SO I suggest trying the following:

    Do uninstall Lightswitch via Control Panel - Uninstall Programs dialog.

    From the sounds of it, you mentioned no other apps were using your current SQL that is installed so it sounds safe to remove your current SQL Server installation. If not safe, please let us know...

    Next (if safe to remove) also via Control Panel - Uninstall Programs dialog, uninstall everything that says "Microsoft SQL Server" .  Please start however with the product named "Microsoft SQL Server 2008" (or Microsoft SQL Server 2008 (64-bit)).  When running through the uninstall wizard, be sure to select to "remove" the instance named SQLEXPRESS.

    After you have confirmed everything has been removed named "Microsoft SQL Server", please reinstall Lightswitch. It will reinstall SQL Express for you with the standard settings that all VS product lines install  with and what Lightswitch is expecting as well.

     

    Hopefullly this goes well.

     

    -Robert Schoen

     

    Thursday, August 04, 2011 5:36 PM
  • Hi Everyone,

    First, I would like everyone to know I appreciate all the help I am getting. Some facts that might be helpful; the operating system I am using is Vista, I have deleted everything SQL and Lightswitch and reinstall LS , LS Beta 1 and Beta 2 ran fine however the moment I installed the Trial version the problem occurred. I am beginning to believe I have a corrupted Active Directory or there is a major bug in LS. I am not sure where to go from here.

    Thanks,

    Ralph

    Thursday, August 04, 2011 9:07 PM
  • I would first look at your SQL Express install, note that the system does not need AD so it has nothing to do with your active directory.

    The first steps I would take is to remove the sqlexpress install and reinstall. Once done verify the configuration details using the sql configruation manager... do not worry about the services app from control panel (do not use that for changing any details regarding the sql server system, you need to use the config manager as it will handle the aditional actions that are required). Next load up visual studio and make sure that you can get a connection to the express databases. I would suggest loading up the sql server managment studio for express on the machine as well.

    Once done and it starts check the event log in system for errors, then move to the application log and chack there. Note that there is also a setup log for express in the sql server directory in the program files directory.


    http://www.virtualrealm.com.au - XNA Game Programming News and Resources from Downunder.
    Thursday, August 04, 2011 10:23 PM
  • I am getting the exact same error, but with an interesting twist that may provide a clue.

    I have an existing LS RTM app that is working great.  I can modify the datasource in SQL, update the datasource in LS, build and run the app with no errors.  But when I try to create a brand new project and use the exact same datasource, I receive this message:

    An error occurred while establishing a connection to SQL Server instance '.\'.

    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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets 157 10 DevExpressTest2

    If I remember right, Steve Hoag suggested that I delete the cache files and try again.  Here is a clip of Steve's response:

    Also, grasping at straws, you might try deleting the cache as described in this post: http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/99ce68e8-52b1-4bd5-b298-7f9159d18ff7

    We haven't seen this particular manifestation before, but having outdated information in the cache can cause some seemingly unrelated problems, and your issue may be one of them.

    Hope this helps,


    Steve Hoag Microsoft aka the V-Bee
    Either way, it is odd that I have 2 LS RTM projects one of which works just fine, while the other throws to SQL error above even though they use the same database?
    My suggestion is don't go down the path of endless uninstalls and reinstalls if you can't pinpoint that as a problem.  That is time consuming, frustrating and may be a huge time suck.
    Good luck, and please post your progress.
     

    Friday, August 05, 2011 12:49 AM
  • More info:  When I REBUILD the project that generates the SQL error I get;  1 error and 66 warnings.  

    The error and all warnings are in the Microsoft.Lightswitch.Targets file.

    The warnings are all similar and refer to: the namespace http://schemas.microsoft.com/developer/msbuild/2003

     

    Warning 1 The element 'PropertyGroup' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003' has invalid child element 'WebPublishingTasksPath' in namespace 'http://schemas.microsoft.com/developer/msbuild/2003'. List of possible elements expected: 'Property, AllowUnsafeBlocks, AppConfigForCompiler, ApplicationIcon, ApplicationRevision, ApplicationVersion, AppDesignerFolder, AspNetConfiguration, AssemblyKeyContainerName, AssemblyKeyProviderName, AssemblyName, AssemblyOriginatorKeyFile, AssemblyOriginatorKeyFileType, AssemblyOriginatorKeyMode, AssemblyType, AutorunEnabled, BaseAddress, BootstrapperComponentsLocation, BootstrapperComponentsUrl, BootstrapperEnabled, CharacterSet, CheckForOverflowUnderflow, CLRSupport, CodePage, Configuration, ConfigurationName, ConfigurationOverrideFile, CreateDesktopShortcut, CreateWebPageOnPublish, CurrentSolutionConfigurationContents, DebugSecurityZoneURL, DebugSymbols, DebugType, DefaultClientScript, DefaultHTMLPageLayout, DefaultTargetSchema, DefineConstants, DefineDebug, DefineTrace, DelaySign, DisableLangXtns, DisallowUrlActivation, CodeAnalysisAdditionalOptions, CodeAnalysisApplyLogFileXsl, CodeAnalysisConsoleXsl, CodeAnalysisCulture, CodeAnalysisFailOnMissingRules, CodeAnalysisForceOutput, CodeAnalysisGenerateS.... C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets 19 10 Miscellaneous Files

    I'm not sure whether the warnings are a result of the error, the source of the error or are coincidental to the error.
    My best guess is that this has something to do with MSBUILD rather than your lightswitch or SQL installs

    Friday, August 05, 2011 1:20 AM
  • Same exact error here.  I cleared the sql files as indicated earlier, still same error.  The rest of VS 2010 Pro works fine.  I have Sql 2008 R2.  Here is the first part of msg:"An error occurred while establishing a connection to SQL Server instance '.\PAOLO-PC\SQLEXPRESS'" 

     The instance name is correct and works fine when no in LS. 

    Thanks

    Friday, August 05, 2011 2:44 PM
  • PaolaTCS/MarkA

    Is this the first time you have had Lightswitch installed on this machine (no previous Beta installs)?  Can you check the settings within visual studio related to SQL connections?  Go to menu "TOOLs-->Options-->Database Tools-->Data Connections" and tell me the value that is set for the "SQL Server Instance Name"?  if you are wanting to work against the local SQLEXPRESS instance, the value there should be "SQLEXPRESS"  (without the double quotes) and nothing else.

     

    thanks

    -Robert Schoen

     

    Friday, August 05, 2011 3:29 PM
  • Hello Robert,

     

    Thanks for the quick reply.  That parameter is set to PAOLO-PC\SQLEXPRESS, which is the name of the instance of my Sql Server 2008 R2.  Originally it was set for SqlExpress, but I got error messages that way too.  (I will retry now, however, after emptying  SQL files, etc.  ...  Do I need to re-install Sql Server 2008 R2 so as to get the default instance? 

     

    Thanks again,

     

    Paolo

    Friday, August 05, 2011 6:07 PM
  • Robert

    I made the change you suggested: "TOOLs-->Options-->Database Tools-->Data Connections"

    mine was blank which I guess means to use the default server?  I entered the value SQLEXPRESS and pressed F5.  No difference found.

    I still have one SLN which builds and loads fine and one SLN which fails on BUILD.  Both projects use the same database, server and OPTIONS.  If I answer YES on the dialog that asks if I'd like to use the last successful build (and there are none), then LS loads the debug app and all data records display the dread red x.

     

    Hmmmmm..

    Friday, August 05, 2011 6:58 PM
  • Yes, blank would be the default server.   Can you check to see what the SQL service instance name that is running?  You can open Task Manager (Cntrl+Delete--> Start Task Manager) and review in the "Services" tab of Task Manager and you should see something like: "MSSQL$SQLEXPRESS"  or something similar. What ever the name follows the $ sign is the name of your running sql express instance that should be in your Tools-Options-Datbase Tools setting.  Additionally while there, ensure that the "Status" of that service is in the "Running" state (as seen in the Task Manager).

    -Robert Schoen

     

    Friday, August 05, 2011 7:31 PM
  • I chk'd TASKMGR - SVCS and MSSQL$SQLEXPRESS is RUNNING.  that is the same name as in the LS OPTIONS.

    But why would one LS RTM proj build OK and another FAIL??  Again, both projs connect to the same SQLEXPRESS DB

     

    -Mark

     

    Friday, August 05, 2011 8:03 PM
  • Robert,

    Here is a copy of the error message I rcv:

     

    An error occurred while establishing a connection to SQL Server instance '.\'.

    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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\LightSwitch\v1.0\Microsoft.LightSwitch.targets 157 10 DevExpressTest2

    pls note that the SQL Server instance IS NOT .\SQLEXPRESS   I wonder where Microsoft.LightSwitch.targets is getting this value.
    the code at line 157 is:
            <BuildSchema Inputs="@(LightSwitchModel)"
                         ProjectPath="$(MSBuildProjectFullPath)"
                         OutputDirectory="Bin\Data"
                         SqlExpressInstanceName="$(SqlExpressInstanceName)"
                         ExternalDataSources="@(ServerExternalDataSources)"/>

     

    Friday, August 05, 2011 8:37 PM
  • Hi Mark,

    If you refer to my answer in the following thread, can you find out what your .lsproj SQLEPXRESSINSTANCENAME value is set to in the project that works for you?

    http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/1315f882-94a2-41a6-8e59-c229328a4c34

    If you compare it to the value in the .lsproj file of your new project that doesn't work, is there any difference? If so, can you replace this value with the value from your working project?

    Tim

    • Proposed as answer by MarkA Howell Friday, August 05, 2011 11:09 PM
    Friday, August 05, 2011 10:24 PM
  • Thanks Tim,

    Here was the value of the .lsproj tag for the project that wouldn't build.

       <SqlExpressInstanceName />

    So even though I modified the  "TOOLs-->Options-->Database Tools-->Data Connections", the lsproj file did not update.

    I guess I need to set that option prior to attaching to an external data source.

     

    I modified the tag to

    <SqlExpressInstanceName>SQLEXPRESS</SqlExpressInstanceName>

     

    and now it completes the BUILD cycle just fine (I'm excited), but I still get those pesky red x's instead of actual data from my database.

     

    Thanks for the tip, Tim!  And if you have a hint on the Red X problem I'd appreciate the pointer.

    Mark


    Friday, August 05, 2011 11:09 PM
  • Same error here.

    From Windows Events:

    Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. [CLIENT: <local machine>]

    Thanks,

    Vítor

    Saturday, August 06, 2011 12:53 AM
  • syncord.....No.

    I am already able to load and view data in my SQLEXPRESS database in my LS RTM project, but when I create a second project trying to attach to the same database the build failed.  Robert and Tim provided clues to help me solve the build error but now I am getting the red X.  

     

    I followed your links and tried those fixes.  I still get the red x instead of data

     

    Saturday, August 06, 2011 1:48 AM
  • Yes Mark, you will often get a whole bunch of errors & warnings as a result of an earlier error.

    Yann

    (plus ça change, plus c'est la même chose!)

    Saturday, August 06, 2011 3:59 AM
    Moderator
  • As Tim actually pointed out in the post he referenced, changing that setting in VS will only affect *future* LS projects that are created after the setting is changed. It doesn't affect projects that were created prior to the setting being changed.

    The ONLY way to change the value for a project that has already been created is to edit the project file (lsproj) manually.


    Yann

    (plus ça change, plus c'est la même chose!)

    Saturday, August 06, 2011 4:04 AM
    Moderator
  • The "red x" *could* be a corrupted SQL log file. Deleting it has solved a "red x" for me a few times.

    No guarantee it'll be your solution though.


    Yann

    (plus ça change, plus c'est la même chose!)

    Saturday, August 06, 2011 4:05 AM
    Moderator
  • Yann,

    Thanks for the input.  I did manually edit the lsproj file and got the project to successful BUILD although that is when the red x appeared.

    I have created further simple projects with the OPTION correctly set to SQLEXPRESS but I still get the red x.

    At least my original project still runs fine with the exact same DB.  I can't seem to find this ghost but I can say it doesn't worry me a bit.  I'd like to have a testproj to try the devexpress extension in but I can't seem to set one up.  I have deleted log files, reset registry entries, cleared caches and reinstalled software. 

     

    Yikes.  If I do find an answer I will post as much detail as possible.

     

     

    Saturday, August 06, 2011 4:18 AM
  • Mark,

    Glad you're one step further now!

    The 'red x' issue can be caused by many reasons and is difficult to diagnose. As Yann says, deleting the .ldf is a common fix.

    One thing that I have learned though - if the screen attempts to load for 30 seconds before displaying the red x, it's likely to be a SQL connection issue rather than some other SQL issue since this corresponds with the default connection timeout period of 30s.

    Hope you find your answer!

    Tim

     

    Saturday, August 06, 2011 10:56 AM
  • Mark, it gets this value from the project file.

    Yann

    (plus ça change, plus c'est la même chose!)

    Saturday, August 06, 2011 11:15 AM
    Moderator
  • Tim and Yann,

    Thanks for all your help.  I appreciate it.  When your book is releases you can be sure I'll have a copy.

    Meanwhile, Tim, it only takes 10 or 12 seconds to Build, Load and display a 'RED X', so I think my connection string is fine.

    I decided to create a new project from scratch again today to be sure to log file was not an issue.  I attached to my one and only DB and created a single screen (an Editable Grid based on the Item Master).

    When I press F5 the new project built successful and loaded to the 'Red X' in 10 or 12 seconds.  I flipped back to VS10 without closing the debug window and found a long list of errors (Great!  This is a new clue.  Previously I had been closing the Debug window at which point all the errors are cleared).

    Here is the 1st of 48 errors all of which are very similar:

    Error 1 Type Microsoft.VisualStudio.Data.Schema.Package.Sql.Project.Features.DirectoryLayoutFeature, Microsoft.VisualStudio.Data.Schema.Package.Sql, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a is not a valid extension type. 0 0

    I opened FILE Manager to the %poject%/Bin/Data directory and found ApplicationDatabase.mdf, but no ApplicationDatabase_log.ldf.
    I am thinking now that my SQL Server install is corrupt.  I have the follow installed on 7/27/2011:
    Microsoft SQL Server 2008 R2 (64-bit) 
    Microsoft SQL Server 2008 R2 Management Objects 10.50.1750.9 
    Microsoft SQL Server 2008 R2 Native Client             10.50.1600.1 
    Microsoft SQL Server 2008 R2 Policies                    10.50.1600.1 
    Microsoft SQL Server 2008 R2 Setup (english)         10.50.1600.1 
    Microsoft SQL Server 2008 R2 Setup Support Files   10.1.2731.0 
    Microsoft SQL Server 2008 R2 Browser                    10.50.1600.1 0
    Microsoft SQL Server Compact 3.5 SP2 ENU             3.5.8080.0 
    Microsoft SQL Server Compact 3.5 SP2 Query Tools ENU             3.5.8080.0 
    Microsoft SQL Server Compact 3.5 SP2 x64 ENU             3.5.8080.0 
    Microsoft SQL Server System CLR Types                 10.50.1750.9 
    Microsoft SQL Server VSS Writer                             10.50.1600.1
    I don't mind reinstalling SQL, and really only need the minimum required to support SQLEXPRESS and SSMS.  But I'm scared to death to lose my database and LS app.
    Thanks again for all your help to this point.
    Mark 
     

    Saturday, August 06, 2011 1:38 PM
  • Mark, regarding the "red x" issue.  Did you happen to have Lightswitch Beta1 (or beta2) installed previously?  If yes, can you confirm that you do not have any Lightswitch "Beta" products still installed? 

    Please go to http://blogs.msdn.com/b/astebner/archive/2005/07/01/using-msiinv-to-gather-information-about-what-is-installed-on-a-computer.aspx and follow the directions getting msiinv.exe and on how to use msiinv.exe to output what products are installed on your machine.

    Once you have this output info, you will need to look for anything that says "LightSwitch" and "beta" in that output. Take the corresponding "productcode" for each Lightswitch "BETA" products and run from an elevated command prompt something like the following:

    msiexec.exe /x {yourlightswitchproductcode} /quiet

    Do this for any Lightswitch stuff beta stuff. I have seen this "Red X" issue come up to do having some "old" Beta1 stuff installed.

     

    thanks

    -Robert Schoen

    Monday, August 08, 2011 4:09 PM
  • Also, please try a simple scenairo where you are not attaching to any existing database and ensure that is working as expected without the "red x" issue.

     

    Scenario to try:

    1. Launch a brand new visual studio (devenv) process --> Create a new VB lightswitch project -->Just create a new table with a single field (string) --> Add a List and Details screen with the attached datasource the previously created table.
    2. Now F5 (debug) your application
    3. Can you add and save data correctly? Does the red x stuff show up?

    thanks

    Robert Schoen

    Monday, August 08, 2011 4:13 PM
  • Somebody just shoot me and put me out of my misery.

    Since my last post on this thread I have spent hours, no make that DAYS, chase my tail around this problem.  On Saturday morning I made the decision to just uninstall everything and begin again fresh.

     

     

    • I uninstalled LS RTM
    • I uninstalled VS2010Pro
    • I uninstalled SQLServer2008 R2
    • I removed all associated file folders
    • I removed all associated registry entries
    • I verified the uninstall was complete using MSIINV
    • I have since downloaded the latest SQL2008R2 Trial ISO file and the latest LS RTM installer.
    • I have found and removed the appdata/localsettings/microsoft corporation folder
    • and rebooted my WIN 7 x 64 PC ( i think it was at least once, but maybe it was 1,000 times )
    • I got a clean install (no errors at all!! YEAY) of SQL2008R2 creating a single instance named SQLEXPRESS using WINDOWS AUTHENTICATION

     

     

     

     

     

     

     

     

     

     

    Here're bits of the SQL2008R2 install summary log

    Overall summary:

      Final result:                  Passed but reboot required, see logs for details

      Exit code (Decimal):           3010

      Exit message:                  Passed but reboot required, see logs for details

      Start time:                    2011-08-09 13:54:26

      End time:                      2011-08-09 14:03:10

      Requested action:              Install

     

    Machine Properties:

      Machine name:                  MARKSHPLAPTOP

      Machine processor count:       4

      OS version:                    Windows 7

      OS service pack:              

      OS region:                     United States

      OS language:                   English (United States)

      OS architecture:               x64

      Process architecture:          64 Bit

      OS clustered:                  No

     

    Package properties:

      Description:                   SQL Server Database Services 2008 R2

      ProductName:                   SQL Server 2008 R2

      Type:                          RTM

      Version:                       10

      SPLevel:                       0

     

    Detailed results:

      Feature:                       Database Engine Services

      Status:                        Passed

      MSI status:                    Passed

      Configuration status:          Passed

     

      Feature:                       SQL Server Replication

      Status:                        Passed

      MSI status:                    Passed

      Configuration status:          Passed

     

      Feature:                       Full-Text Search

      Status:                        Passed

      MSI status:                    Passed

      Configuration status:          Passed

     

      Feature:                       Management Tools - Complete

      Status:                        Passed

      MSI status:                    Passed

      Configuration status:          Passed

     

      Feature:                       Management Tools - Basic

      Status:                        Passed

      MSI status:                    Passed

      Configuration status:          Passed

     

     

     

    I have verified that I can attach to my SQLEXPRESS server instance in SQL SSMS and edit my database, tables and data.

     

    FINE!

     

     

    But my clean new install of LS RTM does not recognize my SQLEXPRESS server instance AT ALL.

     

    Apparently my clean install of lightswitch is not so clean.

     

    Are there caches somewhere that need to be deleted prior to install?

    Is there an XML config file that I can edit to get VS10 Lightswitch to recognize my SQLEXPRESS Instance.?

    Is someone will to drive to New Mexico and shoot me?

     

    On the verge,

    Mark

    Tuesday, August 09, 2011 10:38 PM
  • It looks like my weekend of sleepless nights uninstalling and reinstalling SQL 2008 R2 has left some bad juju in my registry.

     

    I found this msg in my SQL Sever Agent Log:

    Date 8/9/2011 2:02:54 PM

    Log SQL Server Agent (Archive #7 - 8/9/2011 2:02:00 PM)

     

    Message

    [298] SQLServer Error: 27, Registry information is corrupt or missing. Make sure the provider installed and registered correctly. [SQLSTATE 08001]

    Wednesday, August 10, 2011 12:22 AM
  • Ralph20

    I have been away for a few days and have not been keeping up with the discussion, however to let you know, I got my problem solved. Here is how I solvwd the original "An error occurred while establishing a connection to SQL Server instance " I deleted every thing that was labled Microsoft, SQL, Lightswitch, Silverlight .NET Framework, etc,etc... Microsoft Office is the onlything I did not delete. I then reinstalled Lightswitch, opened a new test project(1 Table 3 Data Itens, 1 Add Data Screen) I then BUILD the application and it build fine. I then opened the new application's project file(lsproj)  and copy the entire sql statement and replace the sql statement in the non working project file. I was delighted when te thing BUILD without an error. I at least expected Red x. Mark hold on you have some great peaple helping.  ...Ralph

    Wednesday, August 10, 2011 6:45 AM
  • Hi Mark,

    So after reinstalling everything, is it still the error below that you're getting or are you seeing some different SQL error?

    An error occurred while establishing a connection to SQL Server instance '.\'.

    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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

    Tim

    Wednesday, August 10, 2011 8:40 AM
  • Hi Tim,

     

    That is my exact message.  Also a variation on that with connection to SQL Server instance '.\SQLEXPRESS'.  depending on how I set my database option in Lightswitch.

     

    I have decided to go back to the drawing board again after finding this page from Beth Massi

    http://blogs.msdn.com/b/bethmassi/archive/2011/02/18/step-by-step-installing-sql-server-management-studio-2008-express-after-visual-studio-2010.aspx

     

    I have:

    • uninstalled SQL 2008 R2
    • uninstalled Lightswitch RTM
    • Removed associated folders
    • verified the uninstall process using msiinv
    • used ccleaner to remove orphaned registry entries
    • rebooted
    • installed only LS RTM from my VSLS2011_ENU.iso

    The install failed because SQL EXPRESS Service Pack 1 could not be installed on my machine (Win7 x64)

    This left the install in a broken state and I had:

    • to use msiinv.exe -p > inventory.txt to list the installed components
    • Search for SQL R2 components and remove them using MSIEXEC.exe /x {GUID} /quiet  (Thanks Robert!)

    Now that I am back to ground zero, (No VS2010Pro, No SQL 2008 R2, No Lightswitch)  I am trying the bare Lightswitch install again using vs_vslsweb

     

    I have learned a lot since 7/27/11! and everyone here has been very helpful so I like to thank Tim Robert and Yann specifically, but also many many posts on this and other forums that have provided tips and clues.

     

    You know?  What I want is not complicated.

    I want:

    • VS Lightswitch RTM installed on my HP Pavilion dv7 (Win7 x64) with SQL R2 Express and Management tools
    • I want to use the DB I designed and loaded way back when LS B2 first came out (probably too much to ask since it seems that each different version of SQL 08 R2 has its own particular format which may or may not be able to read other DBs)
    • I'd like to use my beloved LSPROJ that I spent weeks and weeks on getting every label and computed field just right (also probably too much to ask)
    • and finally I'd like to install, learn and use the Dev Express XTRA reports extensions so I can finally deploy my app

    Meanwhile, I'm waiting for vs_vslsweb to complete with my fingers crossed and full of confidence.


    Wednesday, August 10, 2011 3:25 PM
  • [08/10/11,09:31:36] Microsoft SQL Server 2008 Express Service Pack 1 (x64): [2] Error code -2068643839 for this component is not recognized.
    [08/10/11,09:31:36] Microsoft SQL Server 2008 Express Service Pack 1 (x64): [2] Component Microsoft SQL Server 2008 Express Service Pack 1 (x64) returned an unexpected value.
    Dammit
    Wednesday, August 10, 2011 3:32 PM
  • Robert,

    I've had to repeat these steps but without the /QUIET switch since it hides failed uninstalls:

    • to use msiinv.exe -p > inventory.txt to list the installed components
    • Search for SQL R2 components and remove them using MSIEXEC.exe /x {GUID} 
    • to use msiinv.exe -p > inventory.txt to verify that EVERYTHING was properly uninstalled

    I guess I will attempt to install SQL_EXPRWT_x86_ENU to prior to using VSLS2011_ENU

    Wednesday, August 10, 2011 4:27 PM
  • ACCCKKKKK!!

    I get a PROGRAM COMPATIBILITY ASSISTANT popup warning me that SQL_EXPRWT_x86_ENU is not compatible with my WIN7 x64 hardware.

     

    I'm wondering if it is possible at all to install SQL EXPRESS R2 with Management Tools on my machine.

     

    YANN, TIM, ROBERT any ideas?

    Wednesday, August 10, 2011 4:31 PM
  • Hi Mark,

    Is it not SQL_EXPRWT_x64_ENU that you need since you have Windows 7 64bit installed?

    Tim

     

    Wednesday, August 10, 2011 4:43 PM
  • Hi Mark

    I would recommend the following:

    • Uninstall all your current SQLExpress R2 installation through the ControlPanel->Uninstall Programs dialog. 
    • Then from Administrator (elevated) command prompt  reinstall SQLExpress R2 (x64) version that you have with the following commandline:

    <yoursourcepath>\SQLExpr_x64_enu.exe /q /ACTION=Install /FEATURES=SQL /INSTANCENAME=SQLEXPRESS /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSVCStartupType=Automatic /AddCurrentUserAsSqlAdmin /ENABLERANU=1 /SKIPRULES=RebootRequiredCheck /hideconsole /TIMESTAMP="VSExpress_10.0"

     

    After the above install of SQLExpress finishes (Please monitor the processes - this take some time - likely 15 minutes?). 

    Then try to install Lightswitch again.   It should bypass installing SQLExpress and just install Lightswitch.

    -Robert Schoen

    Wednesday, August 10, 2011 5:13 PM
  • Hi Tim,

    It is, but I have never had a successful download of that file.

    Wednesday, August 10, 2011 5:15 PM
  • 6 attempts today and download of SQLEXPRWT_x64_ENU.exe fails each time.

    Instead I have successfully downloaded 

    • SQLEXPR_x64_ENU.exe and 
    • SQLManagementStudio_x64_ENU

     

    The install of SQL_x64_ENU completed successfully, but when I launched SQLManagementStudio_x64 (as Administrator) and clicked the Add common features options, Management Tools Basic was not there.  and the Connectivity SDK was already installed.  WTF??

     

    I have now downloaded SQLManagementStudio_x86_ENU since most of those Common features install in the x86 directories anyway.

    (btw my 6th attempt to download SQLEXPRWT_x64_ENU failed after 1 hour having downloaded only 32MB)

    Wednesday, August 10, 2011 7:07 PM
  • Tim, Robert and Yann,

     

    I finally got everything installed in the correct sequence and I am back in business.

    SQLEXPRWT_x64_ENU never would download.


    1. SQLEXPR_x64_ENU.exe  installed great
    2. VSLS2011_ENU  I prefer this over vs_vslsweb because it was already downloaded.
    3. SQLManagementStudio_x64_ENU selected to install common features  (this gives a message that it is incompatible with WIN7, but the fix is to download and install SQLEXPR_x64_ENU and that is already installed)

    To verify I:

    • launched SQL Server Management Studio and restored a backup of my data base (don't forget your backups)
    • created a new project from scratch and added a simple table and listanddetail screen, F5 = AWESOMENESS
    • opened my existing app, updated the datasource, F5 = AWESOMENESS

    No Red X's to be found.

     

    Thanks again,

    Mark

    Wednesday, August 10, 2011 8:47 PM
  • Fantastic - I'm really glad you finally got this working!
    Wednesday, August 10, 2011 10:10 PM
  • Mark, I'm so glad to hear that you finally got things running! Good job that you stuck with it, because now you get to enjoy all that LS has to offer!

    Yann

    (plus ça change, plus c'est la même chose!)

    Wednesday, August 10, 2011 10:22 PM
    Moderator
  • AWESOME!!!!!!

     

    - Robert Schoen

    Thursday, August 11, 2011 2:55 PM
  • I have tried all of the suggestions that were recommended, but I'm still getting and error when trying to build my project.

    I have even tried running the following command

    exec sp_configure 'user instances enabled', 1

    Go

    Reconfigure

     

    I am using SQL Server Express 2008 R2 x64, and running on Windows Server 2003 x64

     

    I have uninstalled and re-installed SQL Express several times, and created new projects with the same results.

     

    Microsoft Visual Studio 2010

    Version 10.0.40219.1 SP1Rel

    Microsoft .NET Framework

    Version 4.0.30319 SP1Rel

    Microsoft Visual Basic 2010   01018-532-2002102-70349

    Microsoft Visual C# 2010   01018-532-2002102-70349

    Microsoft Visual Studio LightSwitch 2011   01018-532-2002102-70349

    Microsoft Visual Studio 2010 Professional - ENU Service Pack 1 (KB983509)   KB983509

    This service pack is for Microsoft Visual Studio 2010 Professional - ENU.

     

    Any ideas,

     

    Thanks,

    Jason


    jason
    Thursday, January 26, 2012 4:25 PM
  • Hi

    This strated happening to me out of the blue.

    I checked this topic and saw this from Robert Schoen:

    "Yes, blank would be the default server" (refering to "TOOLs-->Options-->Database Tools-->Data Connections")

    I just cleared the name of the default server to blank and the problem went away!

    Cheers, Mark.


    Mark

    Monday, March 05, 2012 11:52 PM