Using the TableAdapters is the simplest solution because it is integrated in VS. The disadvantage is that the designer has some problems like you saw when you lost your queries. If your database can schema changes or for more complicated you can use the DataAdapter which gives you more control over the data access.
Hope this helps,
How can I, using the DataAdapter perform the same querys like the ones in the TableAdapter?
What about the UPDATE command?
What if I need to do somethis besides SQL SELECT command (INSERT INTO)?
Can you give me a practical example for this?
My TableAdapter have simple querys, like search a row with specific key, select all rows where a specific field is = to...
I also change the BindingSource connection string, as bellow:
Dim MyConnection As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + dbBaseDados
Me.CircuitosFonteTableAdapter.Connection.ConnectionString = MyConnection
I want to clear this subject once and for all... if I can simple do it by using the DataAdapter instead, that just fine.
I recommend that you review the quickstarts and starter kits put out by Microsoft as a way to learn more about the technology.
A whole bunch of good resources, including numerous books, that could really help you out:
ASP.NET 2.0: http://quickstarts.asp.net/QuickStartv20/aspnet/
The online MSDN Developer's Guide for Windows Form Applications is also indispensible:
They will all teach you the basics of databinding and data access.
You can do update with the DataAdapter. Here's how.
You need a data adapter for each table. For each dataadapter you need to set 4 properties: SelectCommand, UpdateCommand, DeleteCommand, InsertCommand. These four properties take Command objects that you initialize with the sql command (Select, Insert, Update, Delete...) and the parameters that they require. Once that's done, you use it in the same way as the table adapter: You call the Fill method to fill the dataset, and you call Update to update the database.