简体   繁体   中英

Visual Studio local database to online database

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM