hi frds, I want to establish relation between two table. I select both and got table name and field name . After this i have no idea how to form relation b/w that table.
If you have any clue plz provide.
thanks.

specify more..
to select two table u can use JOIN in your sql statement.

I need to programmatically (in c# code) create the relationship
diagram in the database between the linked tables, just like
you can do in the Relationship editor. (Drag the foreign key of the
child to the primary key in the parent).so that the relationship can be made between the two tables
through dragging it to the other table.and also it shows the link diagram between them -------------

If you are asking for SQL code:

ALTER TABLE dbo.PASSWD
ADD CONSTRAINT
   FK_USER_PASSWD FOREIGN KEY
  (
    USERID
  ) REFERENCES dbo.USER
  (
    UID
  ) ON UPDATE  NO ACTION 
    ON DELETE  NO ACTION
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.