views:

24

answers:

2

i'm using vb 2008 and local database sql server compact 3.5 to build a application. the problem is that i can't insert a new data to the database from the app. i'm wrote the query right at dataset and using table adapter. but when i call the query, it succeed but the data don't exist at database.
for example: at table adapter, i made AddData() like: INSERT INTO supplier (kode_supp, name) VALUES (@p1,@p2)

so at the app, i actually can call them by write: frmSupplier.tableadapter.AddData() but it's not working, do i miss something to connect the db? help me..

A: 

You may need to call a commit or update method in order to do this. Not forgetting that when working with data in an app there are often times when you are essentially disconnected from the database and modifications you perform in an app - in memory - may well be some modified view of the "actual" underlying data in the database.

brumScouse
A: 

how can i call a commit or update method then? and yes, i use datagrid to show db data. when i run the app, all data in db is showed. it means that the db and app is connected right? but why when i add data, it's not working. actually when i run it, it says that adding process is success, no error, and it shows at the datagrid. but when i look at database. the data that i add is not there. and in tableadapter, i also make sortData, seachData query, i can use both of them perfectly when i run the app. so, i really confuse why is the insert query didn't work. did i miss something to connect the sqlserver compact 3.5 with vb 2008? but some of them works.

vina