Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Dataset disabling and reenabling constraints

Dataset disabling and reenabling constraints

Scheduled Pinned Locked Moved C#
databasehelpcsharpvisual-studiodebugging
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Johnny 0
    wrote on last edited by
    #1

    I have local datasets where I read using the following function. The obj.Read() simply executes a stored procedure which is a select statement. For some reason, for my only dataset where I have 3 tables, the "this.EnforceConstraints = true;" statements fails saying the constratints where not respected (and it seems to happen only in debug, I never had a complain from the staff using the runtime), but this is not true for three reasons : the database is a copy of what the runtime environement uses, it is intermitenet even if the database does not change and the database has the same relations as the local dataset. (see below for the relations) public void Read() { try { reading = true; this.EnforceConstraints = false; syncTime = DateTime.Now.ToUniversalTime(); foreach (SimpleObjects obj in this.Tables) { obj.Read(); } this.EnforceConstraints = true; reading = false; } catch (Exception e) { ....code..... } } Relations : (Very simple) Relations.Add(new DataRelation("MembersToMembersAssociations", Tables["Members"].Columns[0], Tables["MembersAssociations"].Columns[0])); Relations.Add(new DataRelation("MembersToMembersPhoneNumbers", Tables["Members"].Columns[0], Tables["MembersPhoneNumbers"].Columns[1])); This is very anoying for I am never sure if I delever a new version if the problem will affcet the runtime, Is it a bug in Visual Studio 2005 (version 8.0.50727)? Did anybody else encounter this problem ?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups