0

i am using using LINQ to SQL. when i adding new record to my DB it show that it was add where i taking record, but then i close app and go to my DB, no record i were, if i add manualy in DB and retrieve it get the data.

why i can retrieve data, but not save data which i add.

my add method

   public void insertKelias(Kelias kelias)
    {
        DB13DataContext context = new DB13DataContext();
        context.Kelias.InsertOnSubmit(kelias);
        context.SubmitChanges();
    }

get data metod

    public List<Kelias> Kelias()
    {
        DB13DataContext context = new DB13DataContext();
        return  context.Kelias.ToList();;
    }      
user1406855
  • 11
  • 1
  • 4
  • Two things: Verify your table has a primary key (obviously) and it's being set correctly. Also, if you're using a local MDF, this may be the issue: http://stackoverflow.com/questions/586291/why-isnt-my-submitchanges-working-in-linq-to-sql – SWalters May 08 '13 at 16:32
  • 1
    yes it work the issue thas with debug mode that always coppy DB – user1406855 May 08 '13 at 17:48

0 Answers0