I have created one function whose purpose is to add data to database (I'm using linq to sql)
This is the code I have written
public static void Add(string Name, int Quantitty) {
DataDataContext Database = new DataDataContext();
tests test = new tests();
test.Name = Name;
test.Quantity = (short)Quantitty;
Database.tests.InsertOnSubmit(test);
Database.SubmitChanges();
}
I have opened my application, pressed the button which calls this function and closed application, than I have opened table data in VS and there was no data in database.
I dont understand what I'm doing wrong.