简体   繁体   中英

Why can I not see new rows added to the database?

I am trying to run a .NET project someone gave me that contains a database MDF file and uses LINQ queries in the C# code, such as:

db = new DataClasses1DataContext();
using (db)
{
   res01 r = new res01();
   r.comb_bars = 1;
   r.end_dte = b_list.Last().dteTme.Date;
   r.pers = pers;
   r.st_dte = b_list.First().dteTme.Date;
   r.sym = sym;
   db.res01s.InsertOnSubmit(r);
   db.SubmitChanges();
}

I see that this code runs when I debug it, but it doesn't seem like any rows were added to the database. Yet, I didn't get any errors while running the code. I am using Visual C# Express 2010. How can I see what has been added in the database MDF file that is part of the project?

try to rebind() the grid. because the data have to be reloaded.

Data is stored in the database file inside bin/Debug folder. Open that and check.

See this for more details on connecting to compact db

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