简体   繁体   中英

Deploying Windows forms application with local database

I have few doubts to clear from you all. I had enough to google now. I am very pure to C# .

I have followed some tutorials and then I did Windows Form App with using local database .

It has used Visual Studio 2010 local database file is .sdf format. Then I deploy the project as describe in the tutorial. And I run my application on my PC.

It has no severs installed. But application is working file. I can insert, update and delete data using my app.

After all those. I have developed same application in Visual Studio 2013 using .mdf local database file. Deployed. But it's not working now.

I wanted to know.

  1. what is the best practice to work with databases?
  2. How can I deploy my project with database?
  3. Can I run windows form app in any pc that haven't sql severs?
  4. (sdf) is not more available in VS13. So, What is the local database similar to (sdf) now?

Please, I hope you all have kind reply.

I guess the second application is not working because it needs an instance of SQL Server up and running. SQL Compact edition (sdf) doesn't require a server to run, while SQL Server database (mdf) does.

About your other questions.

There is not a "best practice", you use one or another depending of your requirements.

You can use an SQL script to create your database during installation process.

Yes, you can run winforms in any machine with a .net runtime installed, it doesn't have to do at all with SQL Server.

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