SQL Server Developer Center > SQL Server Forums > SQL Server Compact > ConnectionString Builder not working for SLQ CE connection VS 2008
Ask a questionAsk a question
 

AnswerConnectionString Builder not working for SLQ CE connection VS 2008

  • Wednesday, October 28, 2009 10:16 PMfswitz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I'm dropping a sqlCeConnection1 on my form in C#.   When I select this connection and try to build the connection properties for the ConnnectionString, nothing appears in my VS Properties.  (With SQL Express or OldDB connection objects a dialog box will appear for a <new connection>

    Any ideas?
    Thanks
    Fritz Switzer

Answers

All Replies

  • Thursday, October 29, 2009 7:37 AMHarrie KalaChakra Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Fritz,

    take a look at these connectionstrings:

    http://connectionstrings.com/sql-server-2005-ce



    Regards,

    -Harrie-
  • Thursday, October 29, 2009 2:59 PMfswitz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Thanks Harrie,

    But it is not the "connection string", it is the loss of the Connection String Builder that is part of the Properties page when you drop a sqlCeConnection on a WinForm. 

    With other connections, OleDbConnection or SqlConnection my Visual Studio 2008 properties box for those connections will have a "drop down" arrow that will let me build the connection string.   With sqlCeConnection there is no drop down arrow.  

    My question is :  Is this normal?  How can I fix it?

    Thanks

    Fritz

    Fritz Switzer
  • Friday, October 30, 2009 2:25 AMHarrie KalaChakra Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Do you mean there isn't any drop down arrow in "Add Connection" Windows Properties while you add "Microsoft SQL Server Compact 3.5 (.NET Framework Data Provider for Microsoft SQL Server Compact 3.5)" as Data Source??

    SqlCEConnection database is file based, it is not like SqlServer that has server side.

    It's a normal for SqlCEConnection. Just click on Create if you don't have any database file, or click Browse if you have had one.

    Happy Coding and Welcome to SQL Server Compact World ;)


    -Harrie-
  • Friday, October 30, 2009 4:04 AMfswitz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Harrie,

    Sorry, it is a bit difficult to describe the VS 2008 screen  I know, thank you for your persistence.

    Here are the steps.  (Winforms project)

    1.  Select and drop a SqlCeConnection from the Toolbox on the form. (creates a sqlCeConnection1 on the bottom of the form. )

    2.  Open the Properties Tab for the sqlCeConnection1 where you can select different properties, e.g.  (Name),ConnectionString,ConnectionTimeout, etc.  

    3.   Place curson on the ConnectionString property....here is where you will find a drop down arrow for any other type of Connection,  sqlConnection, oleDbConnection, OdbcConnection.  

    This is what I cannot find and appears to be missing.  I can type in the field "Data Source=foo.sdf" however, I just want to know why/where the dropdown is and where the ConnectionString builder is?

    Thanks again for your perseverence.

    Fritz

    Fritz Switzer
  • Friday, October 30, 2009 6:38 AMHarrie KalaChakra Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    Hi Fritz,

    There isn't any drop down arrow for ConnectionString Builder in SqlCEConnection Properties. Why are you so depending on properties rather than code by yourself??

    You don't have to add SqlCEConnection if you can code it. Just import the reference and make connectionstring in code form.

    Here is the sample code:

    Imports System.Data.SqlServerCe
    ...
    Dim connCE As SqlCeConnection = Nothing
    connCE = New SqlCeConnection("Data Source=" & SourcePath)
    ...
    

    -Harrie-
  • Friday, October 30, 2009 2:43 PMfswitz Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Harrie,

    Thank you for your comments.  

    Because all of the other Connections have the drop down, I would have thought the SqlCeConnection would behave consistently.   Seems a bit "hay-bagged" that it doesn't act like the other connections.

    And yes, I know I can set the properties in code.

    So it goes,

    Fritz

    Fritz Switzer


  • Monday, November 02, 2009 2:07 AMHarrie KalaChakra Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi Fritz,

    Read this first if you wanna learn 'bout Sql Server CE :

    http://www.microsoft.com/sqlserver/2005/en/us/compact.aspx



    -Harrie-


    if that is what you want, just mark it as answer