How you will set the datarelation between two columns?

Answer Posted / swapna

ADO.NET provides DataRelation object to set relation
between two columns.It helps to enforce the following
constraints,a unique constraint, which guarantees that a
column in the table contains no duplicates and a foreign-
key constraint,which can be used to maintain referential
integrity.

A unique constraint is implemented either by simply setting
the Unique property of a data column to true, or by adding
an instance of the UniqueConstraint class to the
DataRelation object's ParentKeyConstraint.

As part of the foreign-key constraint, you can specify
referential integrity rules that are applied at three
points,when a parent record is updated,when a parent record
is deleted and when a change is accepted or rejected.

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we add relation between tables in a dataset?

754


What is the difference between statement and preparedstatement interface?

774


Which parameter of ConnectionString is used to specify the name of the database?

782


What is the difference between Optimistic and Pessimistic locking?

748


What is ado.net connection?

681


Does executenonquery return a value?

721


What are the advantage of ado.net?

745


How does entity framework work?

660


What is microsoft ado?

702


What is ado.net and its features?

738


What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?

734


What is the use of adodc?

739


How to create data relations?

743


What are the different ado.net namespaces?

837


What is the role of data provider in ado.net?

747