You retrieve a particular customer detail by giving the
Right click dataset and click add>Query as shown below.
Figure 6 – Customer Table
This will bring up a new window.
Figure 7 – TableAdapter Configuration for Command
Select the appropriate option; I have selected “Use SQL
Clicking Next will bring a window like the one below.
Figure 8 – TableAdapter Configuration for Query
Select the query type. I have selected the first option:
“Select which returns rows.” Click Next and this will bring up a window to
specify the query. Give the parameters with “@” character pre-pended to it.
Figure 9 – TableAdapter Configuration for SQL
I would like to return details of a customer on giving the
customerid in this example so I have given the query:
Select * from Customers where CustomerID = @CustomerID.
Click Finish. We have just added a select functionality to
the typed dataset using TableAdapter writing a single line of code.