Visual Basic 2005.Net TableAdapters

G

Guest

When using the VS Wizards to create a DataSet I select tables. Then, I use
the TableAdapter Configuration Wizard to modify the underlying queries that
retreive the data. What I'm wonder is, does this TableAdapter work in the
same manner as a SQL Server Stored Procedure or View? Or, does it work like
MS Access where it pulls all the data over and then filters it?

Or, should I be making my data sources for the TableAdapters stored
procedures and Views instead?

Thank You,

Greg Setnes
 
R

Ralph

Greg said:
When using the VS Wizards to create a DataSet I select tables. Then, I use
the TableAdapter Configuration Wizard to modify the underlying queries that
retreive the data. What I'm wonder is, does this TableAdapter work in the
same manner as a SQL Server Stored Procedure or View? Or, does it work like
MS Access where it pulls all the data over and then filters it?

Or, should I be making my data sources for the TableAdapters stored
procedures and Views instead?

Thank You,

Greg Setnes

"Work in the same manner" makes it tough to give a straight answer. But if I
understand you correctly - then No.

Basically ADO.Net by default doesn't have a "client-side cursor". It is
"disconnected". So everything, unless you do call an SP, is client-side
processing. It depends on how the apdaptor is configured if "all the data is
pulled over".

Does that help? Or did I missunderstand something?

-ralph
 
G

Guest

What I'm wonder is, does this TableAdapter work in the
same manner as a SQL Server Stored Procedure or View? Or, does it work
like MS Access where it pulls all the data over and then filters it?

It runs the query on the server, pulls the data down into a dataset.
 
L

Linda Liu [MSFT]

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.
 
G

Guest

I think my question may not have been clear enough. When I initially create a
TableAdapter I select a table, which returns all the records. Now, in some
training materials I have been going through, they suggest I use the Query
Builder to add filter logic to the script. Thus, I load the TableAdapters
Query Builder and add "WHERE CustomerID = @CustomerID" so that the Table
Adapter will only display recurds for the current customer selected. My
question is, in MS Access, the process would pull over all the data and then
filter it. But, in the case of SQL Server, the processing takes place on the
server and only returns the resultset. So, in this case, does the
TableAdapter pull over all the records and then filter the resultset, or are
only the resultset being returned?

Thank You.
 
R

Ralph

Greg said:
I think my question may not have been clear enough. When I initially create a
TableAdapter I select a table, which returns all the records. Now, in some
training materials I have been going through, they suggest I use the Query
Builder to add filter logic to the script. Thus, I load the TableAdapters
Query Builder and add "WHERE CustomerID = @CustomerID" so that the Table
Adapter will only display recurds for the current customer selected. My
question is, in MS Access, the process would pull over all the data and then
filter it. But, in the case of SQL Server, the processing takes place on the
server and only returns the resultset. So, in this case, does the
TableAdapter pull over all the records and then filter the resultset, or are
only the resultset being returned?

Thank You.
<snipped>

Only the resultset is being returned.

-ralph
 
L

Linda Liu [MSFT]

Hi Greg,

Thank you for you reply!
in this case, does the TableAdapter pull over all the records and then
filter the esultset, or are only the resultset being returned?

In this case, the SQL command that the TableAdapter executes is like
'select * from customer where customerID = somevalue', so only the
resultset is being returned.

If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support
 
L

Linda Liu [MSFT]

Hi Greg,

I am reviewing this post and would like to know the status of this issue.

If you have any question, please feel free to let me know.

Thank you for using our MSDN Managed Newsgroup Support Service!

Sincerely,
Linda Liu
Microsoft Online Community Support
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top