When going through the enable project wizard and selecting Microsoft Sql Server Comapct for the backend I am prompted to enter the server name and the database name. What should I enter here to connect to an existing database?
3 Answers, 1 is accepted
answered on 20 Nov 2009, 03:30 PM
The server and user name are something that are not required in the case of Sql Server Compact. We will fix this so that they are not required to be specified for CE. You can specify temporary strings for the server and username in the wizard and these will be ignored.
In the database name, please specify the fully qualified path to the database file (.sdf).
Alternatively you can use the standard .NET connection string UI to specify the connection parameters.
i tried a random string for the server name and a fully qualified path to the database but when i ran a test connection it failed. could you provide some more detail on using the built in connection strings with Telerik ORM?
answered on 23 Nov 2009, 02:50 PM
I did try specifying a temporary server name and a fully qualified path to the .sdf file and I could successfully connect to the database.
Please have a look at the 'Use standard connection settings' topic on this page for information about using .NET connection strings instead of the OpenAccess connection settings.
The wizard does not support specifying .NET connection strings for Visual Studio 2005. Nevertheless you can specify a connection string manually in the app.config file. Please add a 'connectionStrings' node under the <configuration> node with the path to the .sdf file -
<add name="DatabaseConnection1" connectionString="data source="D:\SQL CE databases\Northwind.sdf"" providerName="Microsoft.SqlServerCe.Client.3.5" />
and the OpenAccess connection section would be <connection id="DatabaseConnection1">
<connectionString>Data Source=D:\SQL CE databases\Northwind.sdf</connectionString>
This information is provided in the documentation link provided above.