0

I'm working on my programming assignment, and would like the program to store data in a sql database. I have done this by using SqlConnection and SqlCommand variables/methods. My issue is that this program connects to a database on my pc, so when I submit it for marking, the program will not work, because the lecturer doesn't have the database.

a) Is there a way to store a full database as part of a visual studio project? b) Is there a way to submit the database alongside the program in such a way that the connection string will not need to change?

jorkington
  • 103
  • 1
  • 5
  • 2
    Only your instructor or the person who cares for your assignment-submission system can answer this question. If you require an SQL engine built into your program, use SQLite. Read this https://stackoverflow.com/questions/15292880/create-sqlite-database-and-table/15292958#15292958 – O. Jones May 05 '19 at 10:17
  • You can deattach the database from SQL Server and then submit the mdf file along with you project to teacher has the database. If take 10 seconds for the teacher to attach the database to test you assignment. – jdweng May 05 '19 at 11:22

1 Answers1

0

If your programs database has not to be connected to the internet you can use SQLite.

If you need an online database you have to run a server with a public ip address so the connection string must not be changed.

recnac
  • 3,744
  • 6
  • 24
  • 46
programmer444
  • 156
  • 1
  • 5