RE: FK Constraint Raised for no reason I can find?



Hi Greg,

If I do not have a tableadapter for the parten table on the form, how do
i 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 then
other 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 i
create 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



.



Relevant Pages

  • RE: FK Constraint Raised for no reason I can find?
    ... to fill the parent datatable before filling the child. ... You have two options to add a TableAdapter instance for the parent table on ... One is to drag&drop the TableAdapter from the Toolbox onto the ... NorthwindDataSet would be in the NorthwindDataSetTableAdapters namespace. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: ToolBox confusion
    ... The VS2005 toolbox filters the devices based on the current project. ... As for finding the controls on your system, ... TableAdapter is checked already. ... I closed selection dialog, but couldn't ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Table Adapter vs SQL Adapter
    ... A TableAdapter is generated when you execute certain operations, one of which is as you described. ... The only "Table Adapter" i was able to find it the toolbox is, if I add the "SQL Data Adapter" to the toolbox manually. ...
    (microsoft.public.dotnet.languages.vb)