RE: FK Constraint Raised for no reason I can find?
- From: v-lliu@xxxxxxxxxxxxxxxxxxxx (Linda Liu [MSFT])
- Date: Fri, 11 Aug 2006 10:30:43 GMT
Hi Greg,
If I do not have a tableadapter for the parten table on the form, how doi add it?
You have two options to add a TableAdapter instance for the parent table on
the form. One is to drag&drop the TableAdapter from the Toolbox onto the
form and the other is to generate a TableAdapter instance by code.
As for the second option, FYI while TableAdapters are designed with the
Dataset Designer, the TableAdapter classes generated are not generated as
nested classes of the DataSet. They are located in a separate namespace
specific to each dataset. For example, if you have a dataset named
NorthwindDataSet, the TableAdapters associated with the DataTables in the
NorthwindDataSet would be in the NorthwindDataSetTableAdapters namespace.
Below is a sample code to define a TableAdapter instance.
NorthwindDataSetTableAdapters.CustomersTableAdapter customersTableAdapter =
new NorthwindDataSetTableAdapters.CustomersTableAdapter();
Sometimes I see the table adaptors at the top of my toolbox and thenother times they arn't there? why?
Generally speaking, after you build the project in which you define the
DataSet and TableAdapters, the DataSet and all the TableAdapters in it will
show up under the tab of the project in the Toolbox. If they don't show up
in the Toolbox, you could righ-click on the Toolbox and select the Reset
Toolbox from the shortcut menu to display the DataSet and all the
TableAdapters in the Toolbox.
The constraints were not copied into VS2005 not SQL Server? When icreate a databsouce, my tables show up but only a couple of constraints.
Could you tell me which constraints are copied into VS2005 and which
aren't? I performed a test and find that the relationship between two
tables(if you have defined in the DB in advance) is copied to VS2005 when
both the two tables are added to the DataSet by dragging&dropping them from
the Server Explorer onto the DataSet designer.
Hope this helps.
Sincerely,
Linda Liu
Microsoft Online Community Support
.
- Follow-Ups:
- RE: FK Constraint Raised for no reason I can find?
- From: Greg P
- RE: FK Constraint Raised for no reason I can find?
- References:
- RE: FK Constraint Raised for no reason I can find?
- From: Linda Liu [MSFT]
- RE: FK Constraint Raised for no reason I can find?
- From: Greg P
- RE: FK Constraint Raised for no reason I can find?
- From: Greg P
- RE: FK Constraint Raised for no reason I can find?
- Prev by Date: Re: Datagridview does not change with datatable change
- Next by Date: Re: Messagebox in Validating cancels subsequent events
- Previous by thread: RE: FK Constraint Raised for no reason I can find?
- Next by thread: RE: FK Constraint Raised for no reason I can find?
- Index(es):
Relevant Pages
|
|