VS2005 - How to connect to a TableAdapter in the data layer

D

dbuchanan

Here are pertinent parts of my solution structure
\\
Solution 'QMS_01
-QmsDataLayer
---My Project
---app.config
---DataSet1.xsd
-QmsUI
---My Project
------DataSources (folder)
---------QmsDataLayer.DataSet1+lkpDeviceTypeDataTable.datasource
---References
------QmsDataLayer
---Form1
//

In the DataSet of the QmsDataLayer is a DataTable (lkpDeviceType) that
has its "LkpDeviceTypeTableAdapter" configured for the stored
procedures in SQL Server 2000 for Fill and GetData.

On "Form1" in the user interface layer (QmsUI) is a DataGridView whose
source is "lkpDeviceTypeTableAdapterBindingSource"

In Form1 component tray I have
\\
lkpDeviceTypeTableAdapterBindingSource
DataSet11
LkpDeviceTypeTableAdapter1
//

This code is not accepted
\\
LkpDeviceTypeTableAdapter.Fill
//

What am I missing?

dbuchanan
 
D

dbuchanan

I Got a little further...

After playing around a bit with the data layer, the references and also
reviewing other code I was able to enter the following code;

\\
Me.LkpDeviceTypeTableAdapter1.Fill(Me.DataSet11.lkpDeviceTypeDataTable)
//

But it does not accept the last part...
(Me.DataSet11.lkpDeviceTypeDataTable)
There is the squiggle under it an the error says

"'lkpDeviceTypeDataTable' is a type in 'QmsDataLayer.DataSet1' and
cannot be used as an expression"

What do I do next?

dbuchanan
 
B

Bart Mermuys

Hi,

dbuchanan said:
I Got a little further...

After playing around a bit with the data layer, the references and also
reviewing other code I was able to enter the following code;

\\
Me.LkpDeviceTypeTableAdapter1.Fill(Me.DataSet11.lkpDeviceTypeDataTable)

It shouldn't end with 'DataTable' otherwise it's a typed DataTable _class_,
what you need is a property on the Typed DataSet that returns an _instance_
..

Try:
Me.LkpDeviceTypeTableAdapter1.Fill(Me.DataSet11.lkpDeviceType)

Note that when you have made a Data Source ( Menu->Data->Show Data Sources /
Add New Data Source ) you can drag one of the DataTable's to the Form and
everything will be setup for you, you can always use it to look at the
generated code to see how things should be done.


HTH,
Geetings
 

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