c# - Insert data in LINQ Database -


i wonder why can't insert data database using linq. created serviced-base database.

when run program, there no error, still no data appears in database table.

private void button1_click(object sender, eventargs e) {     dataclasses1datacontext ds = new dataclasses1datacontext();     customer cst = new customer();      cst.custname = textboxnama.text;     cst.phone = int.parse(textboxhp.text);     cst.custaddress = textboxalamat.text;      ds.customers.insertonsubmit(cst);      try     {         ds.submitchanges();         messagebox.show("success");     }     catch (exception )     {            throw;     } } 

please check if connected correct database(check connection string).


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -