Constraints in ADO.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sampalmer21
    New Member
    • Feb 2008
    • 11

    #1

    Constraints in ADO.NET

    Using ado.net I can pass commands to sql server with the SqlCommand class. I could use this class to pass in a sql command to set a foreign key constraint.

    I could also use the ForeignKeyConst raint class in ADO.NET to set the foreign key constraint.

    So which is the better way?
  • saran23
    New Member
    • Mar 2008
    • 28

    #2
    Originally posted by sampalmer21
    Using ado.net I can pass commands to sql server with the SqlCommand class. I could use this class to pass in a sql command to set a foreign key constraint.

    I could also use the ForeignKeyConst raint class in ADO.NET to set the foreign key constraint.

    So which is the better way?
    Hi, usually setting constraints must not be done via code, its a seperate Database architect process various criterias must be analysed b4 creating a constraint, It must be done only in the database.
    May i know the reason for which u want to do so?

    Comment

    Working...