DataRelations problem?

0

Mam problem, robię ćwiczenie z książki i niestety jest jakiś błąd.
Czyli sie połanczam i tak wygląda dalszy kod:

       public Form4()
        {
            InitializeComponent();
            polacz();
            dAdapt1 = new SqlDataAdapter("SELECT * FROM dbo.Tabela1", cn);
            dAdapt2 = new SqlDataAdapter("SELECT * FROM dbo.Tabela2", cn);
            invBuilder1 = new SqlCommandBuilder(dAdapt1);
            invBuilder2 = new SqlCommandBuilder(dAdapt2);
            myDS = new DataSet();
            dAdapt1.Fill(myDS, "dbo.Tabela1");
            dAdapt2.Fill(myDS, "dbo.Tabela2");
            BuilderTableRelationship();
        }
        private void BuilderTableRelationship()
        {                                       /*idTable1*/
            DataRelation dr = new DataRelation("Tabela1Order",
                                    myDS.Tables["dbo.Tabela1"].Columns["id"],
                                    myDS.Tables["dbo.Tabela2"].Columns["id"]);/*idTable1*/
            myDS.Relations.Add(dr);

            dataGrid1.SetDataBinding(myDS, "dbo.Tabela1"); /*!!! tutaj ERROR*/
            dataGrid2.SetDataBinding(myDS, "dbo.Tabela2");            
        }

W linii gdzie ustawiam SetDatBinding wyrzuca mi błąd:
Argument exception was unhandled.
Nie można utworzyć listy elementów podrzędnych pola dbo.

Czym to możę być spowodowane, tabele są proste,
Tabela1(id, nazwa)
Tabela2(id, idTable1, nazwa)
Co może być nie tak, że nie chce mi złączyć tych tabel ??

0

a pomiedzy czym masz relacje bo wydaja sie byc /**/

0

Między
Tabela1.id
oraz
Tabela2.idTable1

Związek jeden do wielu.
Właśnie tam co jest zakomentowane /idTable1/ też prubowałem, z taką nazwą pola i ten sam błąd.

0

Podaj co masz w tabelach

0

Chyba najłatwiej będzie mi dać skrypty:
CREATE TABLE [dbo].[Tabela1](
[id] [int] IDENTITY(1,1) NOT NULL,
[nazwa] nchar NULL,
CONSTRAINT [PK_Tabela1] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]


CREATE TABLE [dbo].[Tabela2](
[id] [int] IDENTITY(1,1) NOT NULL,
[idTable1] [int] NOT NULL,
[nazwa] nchar NULL,
CONSTRAINT [PK_Tabela2] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[Tabela2] WITH CHECK ADD CONSTRAINT [FK_Table_1] FOREIGN KEY([idTable1])
REFERENCES [dbo].[Tabela1] ([id])
GO
ALTER TABLE [dbo].[Tabela2] CHECK CONSTRAINT [FK_Table_1]


Dane z tabel:
id nazwa


1 absx
2 a
3 a
4 a
5 a
6 a
7 a
8 a
9 a
10 test
11 test
12 wartosc
Tabela 2
id idTable1 nazwa


2 2 b
3 2 b
4 3 b
5 3 ew
6 1 test
7 1 wer

1 użytkowników online, w tym zalogowanych: 0, gości: 1