can't connect to database sdf (visual studio 2010)
-
- 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
-
- 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
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[^]
-
- 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
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: