skip to main | skip to sidebar
Showing posts with label Data Connections. Show all posts
Showing posts with label Data Connections. Show all posts

Tuesday, March 06, 2007

Orcas March CTP on Vista Database Connections Problem Solved

An anonymous commenter provided the solution to the connection string problem I reported in my March 04, 2007 Orcas March 2007 CTP Installation Problems post: If you set up the Self-Extracting Install version of the Orcas March 2007 CTP on Windows Vista without installing SQL Server 2005 Express, you can't persist Data Connections in Server Explorer. Installing SQL Server 2005 [Express] under any current Windows OS breaks the Project Designer's Properties page and the Workflow Designer. Update 4/25/2007: This fix does not apply to Orcas Beta 1, which doesn't exhibit the preceding problems. See SQL Server Compact Edition FAILS to connect in Server Explorer with Beta 1 in the ADO.NET Orcas forum. Update 3/7/2007: Windows Vista isn't the culprit. "Anonymous" says that the connection string problem also occurs with—and the solution works for—Windows XP SP2. My installation on Windows Server 2003 R2 SP1 under Virtual Server 2005 R2 SP1 Beta 2 didn't have the problem. Inspecting that machine.config file shows that the offending line commented out below wasn't present. I believe I omitted Orcas support for devices from that install. I'll run another test with Windows XP SP2 as the guest OS later this week to confirm. Here's the full text of the comment:

The issue with SQL Connection strings is much larger than what you elude to. It also breaks almost all visual database design tools in Orcas, SQL Server Management Studio and Visual Studio 2005. This includes the table designer, database diagrammer and the view designer.

I have good news though. There is a fix. If you open up the machine.config file you will notice multiple entries for the SQL CE stuff in the system.data section. Comment these out (this will break SQL CE, which is fine for most people) and your SQL Server editing will return. I believe if you comment out 2 of the 3 leaving the version 9 dll intact the SQL CE stuff will remain working.

The commenter is correct. To enable persisting Data Connections in Server Explorer under Windows Vista comment out the line shown in bold from \Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine[.config]:
<system.data>
 <DbProviderFactories>
 <add name="Odbc Data Provider" invariant="System.Data.Odbc" description=".Net Framework Data Provider for Odbc" type="System.Data.Odbc.OdbcFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 <add name="OleDb Data Provider" invariant="System.Data.OleDb" description=".Net Framework Data Provider for OleDb" type="System.Data.OleDb.OleDbFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 <add name="OracleClient Data Provider" invariant="System.Data.OracleClient" description=".Net Framework Data Provider for Oracle" type="System.Data.OracleClient.OracleClientFactory, System.Data.OracleClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 <add name="SqlClient Data Provider" invariant="System.Data.SqlClient" description=".Net Framework Data Provider for SqlServer" type="System.Data.SqlClient.SqlClientFactory, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
 <!-- <add name="SQL Server CE Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server 2005 Everywhere Edition" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> -->
 <add name="SQL Server Compact Edition Data Provider" invariant="System.Data.SqlServerCe" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
 <add name="SQL Server Compact Edition Client Data Provider" invariant="Microsoft.SqlServerCe.Client" description=".NET Framework Data Provider for Microsoft SQL Server Compact Edition Client" type="Microsoft.SqlServerCe.Client.SqlCeClientFactory, Microsoft.SqlServerCe.Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
 </DbProviderFactories>
</system.data>
The SQL Server CE Data Provider element (for v3.1 disguised as v9.0.242.0) appears to conflict with the SQL Server Compact Edition (SSCE) Data Provider v3.5.0.0, which is the correct version for Orcas March 2007 CTP, when running under Windows Vista. Version 3.5 supports the Microsoft Synchronization Services (OCS) CTP, has new data types, and other improvements. Note: The machine.config file is present only in the .NET Framework 2.0's CONFIG folder. The other framework folders (1, 1.1, 3.0, and 3.5) don't have a CONFIG folder.

Here's a screen capture of the line to edit in your machine.config file (click for full size image):

And just to prove that the fixes work, here's a screen capture of Server Explorer showing two remote SQL Server 2005 Express instances and a local SQL Server 2005 Compact Edition Test.sdf file created when the connection was made (click for full size image):

Caution: Installing Orcas March 2007 CTP without installing SQL Server 2005 Express (SSX) requires that you change the connection strings for many sample applications, such as those for LINQ to SQL, from local user instances of Northwind.mdf to remote instances of the Northwind sample database. My Updated Orcas March 2007 CTP LINQ C# Samples post provides an example for the Sample Queries project's LinqToSqlSamples class.

Note: Here's a link to an ADO.NET Orcas post from a tester with the problem solved here. Two more confirmations here and here.

Update 3/19/2007: Use Orcas's Server Explorer, not SSMS, to manipulate SSCE data files. Server Explorer's Show Table Data context menu choice lets you edit SSCE table data.

Laxmi Narsimha Rao ORUGANTI from Microsoft India posted the following in the Microsoft Synchronization Services for ADO.NET forum regarding SSCE versioning issues:

With SQL Server 2005 (RTM, SP1, SP2), the version of SQL SERVER COMPACT EDITION integrated with it is 3.0/3.1 (Note: DLL versions would still remain as 3.0.xxxx.0). SQL Server CE 3.5 which is part of ADO.NET Sync Services CTP is not integrated with database management tool SSMS. We would encourage you to use ORCAS to manipulate the Sync Services databases created on client side. SQL Server CE 3.5 is fully integrated with ORCAS. Use Database Explorer (or Server Explorer). We are also working towards to integrate with Orcas Express editions but nothing is concrete or materialized yet so no promises.

Sunday, March 04, 2007

Orcas March 2007 CTP Installation Problems

Project Designer's Properties Pages Are Inoperable Many Orcas March 2007 CTP testers have reported that the Project Designer's Properties pages don't work. A red ball with an X appears and you receive this error for any page you select:

An error occurred trying to load the page. Microsoft.VisualStudio.Shell.WindowPane.OnCreate()

Update 4/25/2007: This fix does not apply to Orcas Beta 1, which doesn't exhibit the preceding problems. See SQL Server Compact Edition FAILS to connect in Server Explorer with Beta 1 in the ADO.NET Orcas forum.

I experienced the same problem with the Self-Extracting Install on Windows Server 2003 R2 and Vista, as well as the VirtualPC Image on Windows Server 2003 SP1, as the guest OS running on Virtual Server 2005 R2. The Visual Studio Code Name “Orcas” Release Notes accessible from the download pages for the Self-Extracting Install and VirtualPC Image (not the Readme that opens when you click the View Readme button of the VS Orcas setup splash screen) states:

19. Working with Project Designer (Project Properties) is unsupported when the CTP is installed on the same machine as VS 2005 or SQL Server 2005.

Project Designer is the feature responsible for configuring application settings, handling application events, managing settings, managing resources, and working with other properties of the project. This feature currently is not supported in the March CTP if the CTP is installed on the same machine (side-by-side) with VS 2005 or SQL Server 2005. This limitation is caused by a known issue in the setup authoring of this component.

To resolve this issue, it is recommended to either:

  • Use the March CTP from a VPC image
  • Install March CTP to a different machine without VS 2005 or SQL Server 2005

This defect was known to Microsoft prior to release of the installation bits, so testers should have been warned about the issue in the download pages and ReadMe file that the setup splash screen's View ReadMe button opens.

The VirtualPC Image includes SQL Server 2005 to support Team Foundation Server; removing the SQL Server components doesn't restore Properties pages operability. You must perform a custom install of the Self-Extracting Install version and clear the SQL Server 2005 Express check box to obtain operable Properties pages.

(SQL Server 2005 Compact Edition components don't cause this problem. Rafik Robeal's four Sync Services projects build and run without issues in Orcas March 2007 under Windows Server 2003 R2 and Vista.)

Note: See Feedback: Project properties Panes not created on Orcas CTP Mars for a similar issue under Vista and Forum: Microsoft.VisualStudio.Shell.WindowPane.OnCreate() for several users experiencing the problem. Side Effects of Not Installing SQL Server 2005 [Express]

1. SQL Server Native Client (Sqlncli) for OLE DB and ODBC connections to SQL Server 2000 and 2005 isn't installed.

You can install the X86, X64, or IA64 Package from links on the Feature Pack for Microsoft SQL Server 2005 - February 2007 page or the X86 package (Sqlncli.msi) directly . 2. You can't persist an SQL Server data connection in the Orcas March Server Explorer when running under Windows Vista.

Update 2/7/2007: This problem has been solved by an anonymous commenter. An extra entry in machine.config for SQL Server 2005 CE v3.1 caused the failure. See the 2/7/2007 Orcas March CTP on Vista Database Connections Problem Solved post.

The Choose Data Source dialog behaves as expected, and selecting Microsoft SQL Server as the Data Source and either .NET Framework Data Provider for SQL Server or OLE DB opens the Add Connection dialog. You can choose a networked instance of SQL Server [Express] in the Server Name list, but the Select or Enter a Database Name list isn't populated with database names. Clicking Test displays the expected (but bogus) message:

If you type a known good database name in the list and then click OK you receive this error message:

Clicking Advanced displays this defective Advanced Properties dialog:

Here's what the Advanced Properties dialog looks like when Orcas March 2007 CTP runs under Windows 2003 Server SP1 or Windows XP SP2:

The same problem occurs when using the dialog to build a connection string from the Properties/Settings page. Typing the approprate connection string in the Settings grid's Values cell doesn't add the required providerName="System.Data.SqlClient" attribute/value pair to the app.config file's <connectionStrings> element. As noted in my earlier Orcas March CTP Available from MSDN post, Windows Vista isn't a supported OS for the Self-Extracting Install version. This problem might explain why. (Vista is a supported OS for the VirtualPC Image version.)

Note: See Feedback: Unable to create data connections in server explorer for another tester with the same problem.

Build Warning about .NET Framework 2.0 update

Building a simple VB project reports in the following warning message:

vbc : warning BC42323: .NET Framework 2.0 update not found. The win32manifest will not be embedded.

The system is using the current version as indicated by this build instruction:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll

Others have reported similar warnings when building C# projects. So far, I haven't found any problems that I can attribute to an outdated .NET Framework 2.0 version.

Note: See Feedback: C# solution upgrade creates error CS1928 for a similar issue and the Properties pages problem.

Subscribe to: Comments (Atom)
 

AltStyle によって変換されたページ (->オリジナル) /