Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. can't connect to database sdf (visual studio 2010)

can't connect to database sdf (visual studio 2010)

Scheduled Pinned Locked Moved Database
databasevisual-studiohelpcsharpwpf
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    siaswar
    wrote on last edited by
    #1
    1. I use vs2010. I want to add a "LOCALE" database to my project. just local not in localserver. connecting vi binding a datagridview works. but connecting vi ado classes (sqlconnection) not work cause wrong connection string. I test many connectionstring even orginal connectionstring that binding use "4 ex: datasource:|datadirectory|\text.sdf" but wrong connection string error occur. in vs 2008 I had no problem. 2) what kind of database is better to use in simple program: local? or in localhost? after publishig the program will use in another pc. is putting db in localhost is work then?

    Thanks, Sia swar Baluch

    D L 2 Replies Last reply
    0
    • S siaswar
      1. I use vs2010. I want to add a "LOCALE" database to my project. just local not in localserver. connecting vi binding a datagridview works. but connecting vi ado classes (sqlconnection) not work cause wrong connection string. I test many connectionstring even orginal connectionstring that binding use "4 ex: datasource:|datadirectory|\text.sdf" but wrong connection string error occur. in vs 2008 I had no problem. 2) what kind of database is better to use in simple program: local? or in localhost? after publishig the program will use in another pc. is putting db in localhost is work then?

      Thanks, Sia swar Baluch

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      This[^] site should help you get the right connection string.

      siaswar wrote:

      what kind of database is better to use in simple program: local? or in localhost? after publishig the program will use in another pc. is putting db in localhost is work then?

      It depends on how are you going to deploy the application. If the database resides on the client computer, local* should be fine. If the database is going be on another computer, connection string should be likewise. Make sure to configure database to allow remote connections (SQL server surface are coanfiguration will help doing that). * I have no idea what you mean when you say "local or localhost".

      "Your code will never work, Luc's always will.", Richard MacCutchan[^]

      1 Reply Last reply
      0
      • S siaswar
        1. I use vs2010. I want to add a "LOCALE" database to my project. just local not in localserver. connecting vi binding a datagridview works. but connecting vi ado classes (sqlconnection) not work cause wrong connection string. I test many connectionstring even orginal connectionstring that binding use "4 ex: datasource:|datadirectory|\text.sdf" but wrong connection string error occur. in vs 2008 I had no problem. 2) what kind of database is better to use in simple program: local? or in localhost? after publishig the program will use in another pc. is putting db in localhost is work then?

        Thanks, Sia swar Baluch

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        siaswar wrote:

        in vs 2008 I had no problem.

        You're using Sql Ce by the looks of it. There might be different versions[^] of the SqlCe driver on your system.

        siaswar wrote:

        what kind of database is better to use in simple program: local? or in localhost?

        Since SqlCe is serverless, I'm assuming that you're comparing SqlCe and SqlExpress. If you're just going to store some data that could have been in a text-file, go for SqlCe. If you need a real database, go for Express.

        I are Troll :suss:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups