I use TableAdapter (DataSetTools) to communicate with my database. I have a datagridview and I want to fill it by result of a search query. This is my code:
myDataSet = name of dataset that I created with dataset tools.
Test = name of my table in database.
myDataSetTableAdapters.TestTableAdapter myTableAdapter = new myDataSetTableAdapters.TestTableAdapter();
myDataSet.TestDataTable dt =myTableAdapter .Search(txtSearch.Text);
TestBindingSource.EndEdit();
TITable.Fill(dt);
testDataGridView.Update();
testDataGridView.Refresh();
The problem is that I don't see any changes in datagridview.
Here is a good (generic) cample which you should be able to follow pretty easily.
Also, check out this example.
You will find MANY other examples using the link below.
http://csharp.net-informations.com/datagridview/csharp-datagridview-database-operations.htm