vs2005 - How to fill form using TableAdapter FillBy

D

dbuchanan

Hello,

I have added a query to my TableAdapter that accepts a parameter (The
ID) to filter the data. It will return only one record. I tested it in
the designer and it returns one record as expected.

However I cannot get it to populate a form of databound controls. What
could I be doing wrong? The controls were dragged onto the form surface
which then made the dataset, tableAdapter and bindingSource in the
forms component tray.

Here is the code in the from_load event
\\
Me.Table1TableAdapter1.FillBy(Me.DataSet11.table1, 2)
//


Here is the stored procedure
\\
CREATE PROCEDURE dbo.usp_Table1_GetById
(
@pkId int
)
AS
SET NOCOUNT ON;
SELECT pkId, Name, Address
FROM Table1
WHERE (pkId = @pkId)
GO
//

(I *can* get a form with a datagridview to return the single record
with the code above)

What am I missing?

Thank you,
dbuchanan
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top