Quote Originally Posted by bea19_ventura View Post
i dont know how to connect the sdf database to a datatable using binding source.
That's no surprise, because that is not possible. You connect to the database and retrieve data into the DataTable, which is then bound to the BindingSource, which is then bound to the UI. What .paul. is asking is basically how you set up the application to retrieve the data in the first place. If you have a DataTable and a BindingSource and you don't know how they work then I think that 's fairly safe to assume that you used the Data Source Wizard to generated a typed DataSet and you then dragged a table from the Data Sources window onto your form. Doing so would add several controls and components to your form as well as a little code.

You should start by having a look at that code, specifically the Load event handler. You should see there that the Fill method of a table adapter is called, which queries the database and fills the DataTable with the result set. That's how you retrieve the data in the first place.

You may actually already have code to save the data too. Is there a call to the UpdateAll method of a table adapter manager? If so then that's what does the saving. It might be in the Click event handler of the Save button of your BindingNavigator. If not then you can easily add save code. You'll probably want to handle the Click event of the Save button but you can put the code wherever is appropriate. You can call UpdateAll on the table adapter manager but, if you're only using one DataTable, you don't need to update all tables. Simply copy the Fill line from the form's Load event handler and change the Call to Update instead of Fill. That's it.