Hi Greg,
What I'm wonder is, does this TableAdapter work in the same manner as a
SQL Server Stored Procedure or View?
No, TableAdapter doesn't work in the same manner as a SQL Server Stored
Procedure or View. In fact, they are different concept.
A stored procedure consists of several SQL statements and compiled on the
SQL Server. A view is based on a table and has some filter conditions. Both
of them reside in database.
TableAdapters provide communication between your application and a
database. More specifically, a TableAdapter connects to a database,
executes queries or stored procedures, and either returns a new data table
populated with the returned data or fills an existing DataTable with the
returned data. TableAdapters are also used to send updated data from your
application back to the database.
does it work like MS Access where it pulls all the data over and then
filters it?
No, TableAdapter pulls the data and fill the returned data into a
DataTable. It doesn't filter the data. If you'd like to filter the data in
a DataTable, you could use a BindingSource or DataView to do it. The
following is a sample:
Dim table As New DataTable
Dim view As New DataView(table)
view.RowFilter = "ID> 1"
-or-
Dim bs As New BindingSource(table, "")
bs.Filter = "ID > 1"
should I be making my data sources for the TableAdapters stored procedures
and Views instead?
TableAdapters can connect to a stored procedure or view to retrieve data
from database. In this case, you needn't config the complex queries by
yourself to retrieve the data and it will be more efficient when retrieving
data from database.
Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.