Reputation: 92
I'm currently using a local database (.sdf
- SQL Server CE) in my Visual Studio application and now I'm trying to use it as a online database but I have some doubts.
Code in use :
SqlCeConnection Conn = new SqlCeConnection("Data Source="
+ "|DataDirectory|\\Database1.sdf");
Does SqlCeConnection
support online databases or only local?
If it does, what are the parameters I should use?
Upvotes: 3
Views: 372
Reputation: 35572
Sure, it does support online databases, but for that you need to restore database in SQL Server. File system databases are not good for that. Install a SQL Server and restore your database there and a user with proper rights.
Now your connection string is like this
Server=serverip\SQLServer;Database=database1;uid=abc;pwd=12345
Upvotes: 1