Microsoft Sql Server Comapct

Thread is closed for posting
4 posts, 0 answers
  1. Robert
    Robert avatar
    2 posts
    Member since:
    Jun 2009

    Posted 20 Nov 2009 Link to this post

    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?
  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 20 Nov 2009 Link to this post

    Hi Robert,

     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.

    Kind regards,
    Ady
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Robert
    Robert avatar
    2 posts
    Member since:
    Jun 2009

    Posted 20 Nov 2009 Link to this post

    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?
  4. Ady
    Admin
    Ady avatar
    589 posts

    Posted 23 Nov 2009 Link to this post

    Hi Robert,

    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 -

    <connectionStrings>
        <add name="DatabaseConnection1" connectionString="data source=&quot;D:\SQL CE databases\Northwind.sdf&quot;" providerName="Microsoft.SqlServerCe.Client.3.5" />
      </connectionStrings>

    and the OpenAccess connection section would be
    <connection id="DatabaseConnection1">
            <connectionString>Data Source=D:\SQL CE databases\Northwind.sdf</connectionString>
            <backendconfigurationname>sqlceConfiguration</backendconfigurationname>
          </connection>

    This information is provided in the documentation link provided above.

    Regards,
    Ady
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top