1

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.

5
  • 1
    "it's not working" is very generic. What doesn't work, and what more information about the problem do you have? Commented Aug 27, 2014 at 12:37
  • @YoryeNathan Not Working means, When I deploy the application in VS13. Insert, Update and Delete part not working. I wanted to know. what is the local database in VS13? Commented Aug 27, 2014 at 12:43
  • @yeshansachithak blogs.msdn.com/b/sqlexpress/archive/2011/07/12/… Commented Aug 27, 2014 at 12:53
  • @yeshansachithak: again, just saying "it's not working" fails to convey anything useful, even if you put other words in front of it. Are the queries returning errors? Are you getting errors connecting to the database? What are the errors? Commented Aug 27, 2014 at 12:54
  • @siride this is the LINK that I followed. I used VS2010. But when I used VS13 to do. There have no option to create (sdf) database. So, I built it using (mdf). So, That's the reason it's not working Commented Aug 27, 2014 at 12:59

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks, I know. I've researched. Problem is, before deploy the application I have add some data to my database. Then I deployed. I can see my data grid view that database data is their. When I insert the data it's working. But when I close the app and opened again. That newly inserted data was not in the data grid view. :-/
@yeshansachithak That will require asking another question, and show us some code.
this is the LINK that I followed. I used VS2010. But when I used VS13 to do. There have no option to create (sdf) database. So, I built it using (mdf). So, That's the reason it's not working

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.