You retrieve a particular customer detail by giving the
CustomerID.
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
Type
Select the appropriate option; I have selected “Use SQL
statements.”
Clicking Next will bring a window like the one below.
Figure 8 – TableAdapter Configuration for Query
Type
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
Statement
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.