It seems that my code can insert data into memory, but not into the database. What I mean is that after "insert data", I can "read data",
which I just insert. When I check the actual database table, it didn't
I am using VS 2005 and table designer. Regarding to this problem, is
it related to any setting of setup of the database? I check the code,
and I have no idea how it occurs.
So the select code at the bottom works? Are you certain the conection string in your config file defo matches the database you have been accessing manually? There is no setting (certainly in SQL Server) that would do what you think is happening.
I figured out the problem by relacing the |DataDirectory| with the physical path of the mdf file. I double check this on the web & find that both of methods should work without a problem. I am not sure why this occurs
It seems that when using virtual path, the data is sored in Memory, not actually in the database.