Question

Locked

binding a scalar table adaptor to a control in vb.net

By Gordon.Hope-Murray ·
I'm trying to create a simple form which displays a combo box with data from a table tasks, I want to display only those tasks that are valid for entries in the Users_tasks table determined by the foreign key UserID from the users table.

I can't add a query to my existing table adaptors because the schema is different, so I added a query in the dataset designer to the query table adaptor.

I now have a scalar table adaptor , and call the query function and pass it the user id, but am unable to bind it to a control on my form.

Dim scalarQueriesTableAdapter As InsightAdminDataSetTableAdapters.QueriesTableAdapter


scalarQueriesTableAdapter = New InsightAdminDataSetTableAdapters.QueriesTableAdapter

scalarQueriesTableAdapter.SelectUserTasks(CurrentUserID)

when executing the query it returns the right data.

i tried adding the querytable adaptor as a datasource, but it doesn't show any of the fields, and the scalattable adaptor doesn't appear at all.

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

A wild idea.....

by robo_dev In reply to binding a scalar table ad ...

When you dim the variable, you need the () at the end or there's no bucket to put the bits into....

Dim northwindDataSet As New NorthwindDataSet()

Dim customersTableAdapter As New NorthwindDataSetTableAdapters.CustomersTableAdapter()

customersTableAdapter.Fill(northwindDataSet.Customers)

Collapse -

It was worth a go

by Gordon.Hope-Murray In reply to A wild idea.....

I've compressed that into one lign, initialising the variable as I declare it and added the parentheses.

Dim scalarQueriesTableAdapter As New InsightAdminDataSetTableAdapters.QueriesTableAdapter()

still no luck though

Collapse -

lack of binding can happen due to data format issues....

by robo_dev In reply to It was worth a go

The bottom line is that the data that is returned to the form is not suitable, so it does not work.

I would guess that there is an error message like 'type mismatch' or 'invalid property value' hidden in there somewhere....

Here is some sample code:
http://www.vbforums.com/showthread.php?t=534121

Back to Software Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums