HighTechTalks DotNet Forums  

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

Dotnet FAQs microsoft.public.dotnet.faqs


Discuss VS2005 - How to connect to a TableAdapter in the data layer in the Dotnet FAQs forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
dbuchanan
 
Posts: n/a

Default VS2005 - How to connect to a TableAdapter in the data layer - 11-30-2005 , 07:59 PM






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.datas ource
---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


Reply With Quote
  #2  
Old   
dbuchanan
 
Posts: n/a

Default Re: VS2005 - How to connect to a TableAdapter in the data layer - 11-30-2005 , 09:25 PM






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.lk pDeviceTypeDataTable)
//

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


Reply With Quote
  #3  
Old   
Bart Mermuys
 
Posts: n/a

Default Re: VS2005 - How to connect to a TableAdapter in the data layer - 12-01-2005 , 04:41 AM



Hi,

"dbuchanan" <dbuchanan52 (AT) hotmail (DOT) com> wrote

Quote:
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.lk pDeviceTypeDataTable)
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.lk pDeviceType)

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



Quote:
//

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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.