I'm building my application using .NET.
I created a SQLExpress
database instance using Visual Studio and connected to it using LINQ.
This is its connection string
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\TicTacToeDB.mdf;Integrated Security=True;User Instance=True
This database contains only one table named Player
.
I coded a stored procedure to insert a player named InsertPlayer
This code is to insert a new player.
TicTacToeDBLINQDataContext context = new TicTacToeDBLINQDataContext();
int? id = 0;
context.InsertPlayer("player1", 0, 0, 0, DateTime.Now, ref id);
context.SubmitChanges();
The problem is nothing is committed in the database and no new record is added.
I figured out that there is an inner copy of the .mdf
file in bin/Debug
directory.
This copy is being used to insert data in.
But when I select data it gives me data from the outer version