Cách sửa lỗi khi lập trình bằng Visual Studio Lightswitch 2011
Trong quá trình lập trình và debug Build Project chúng ta rất thường hay gặp các lỗi sau:
1. If a user has installed SharePoint 2010 on a Windows 7 machine the default SQLExpress Instance is “SharePoint” which doesn’t connect to the default instance of SQLExpress needed by LightSwitch
An error occurred while establishing a connection to SQL Server instance ‘.\.\SharePoint’.
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.
2. Cannot connect to PC-NAME\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) (Microsoft SQL Server, Error: -1) For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
3. I cannot run any LightSwitch program
I downloaded and installed LigthSwitch hopping to start beta testing immediately. Unfortunatelly, it cannot access the SQLExpress database instance, and I could not figure-out what is wrong.
Các bước sửa lỗi như sau:
Changing the option in Options ==> Database Tools==>Data Connections will apply to the new projects that you create.
Try looking for the .lsproj file for you project on the file system. If you open this file in notepad, you’ll see a SQLEPXRESSINSTANCENAME element which will be set to SQLEXPRESS. Correcting this setting may fix your problem.
Deleting all files in the dir ‘%LOCALAPPDATA%\Microsoft\Microsoft SQL Server Data\SQLEXPRESS’ solved the problem.
Please check the ServerName which you provided. It should match with the below shown Name in the UserName textbox, and that name should followed with
I know this question is old, but in case it helps anyone make sure the SQL Server Browser is running in the Services MSC. I installed SQL Server Express 2008 R2 and the SQL Server Browser Service was set to Disabled.
- Find “SQL Server Browser”->Right Click->Properties
- Set Startup Type to Automatic->Click Apply
- Retry your connection.
Posted on 05/08/2012, in Công nghệ và Giáo dục, Chính sách CNTT, LOB, LOB - Lập trình - Phát triển phần mềm, Microsoft, Programming, SQL server, Training Online and tagged Microsoft. Bookmark the permalink. Để lại bình luận.