-
Feb 10th, 2021, 05:09 PM
#1
Thread Starter
Fanatic Member
Typed Dataset cannot read database...
But only one of four tables. The rest work fine.
Here is the logic, the same logic used on other tables
Code:
Dim ta_Completed1 As MaintenanceRequestDataSetTableAdapters.CompletedTableAdapter = New MaintenanceRequestDataSetTableAdapters.CompletedTableAdapter
ta_Completed1.Fill(DS.Completed)
This line:
Code:
ta_Completed1.Fill(DS.Completed)
produces the error:
Failed to enable constraints - One or more rows contain values violating non-null, unique or foreign-key constraints.
Below is the data, four fields... RequestID, ID, Signoff, Date4 and Notes:
RequestID ID Signoff Date4 Notes
98 48 5/27/2020
100 50 5/28/2020
105 55 6/8/2020
106 56 6/8/2020
110 60 6/9/2020
111 61 6/9/2020
113 63 6/10/2020
114 64 6/10/2020
115 65 6/11/2020
117 67 6/11/2020
119 69 6/11/2020
120 70 6/12/2020
121 71 6/12/2020
122 72 6/12/2020
123 73 6/15/2020
124 74 6/16/2020
125 75 6/16/2020
126 76 6/17/2020
127 77 6/18/2020
128 78 6/18/2020
129 79 6/19/2020
130 80 6/19/2020
134 84 6/22/2020
135 85 6/23/2020
136 86 6/24/2020
137 87 6/24/2020
138 88 6/24/2020
139 89 6/25/2020
140 90 6/26/2020
141 91 6/30/2020
142 92 7/1/2020
143 93 7/6/2020
144 94 7/6/2020
145 95 7/7/2020
146 96 7/8/2020
147 97 7/13/2020
148 98 7/13/2020
149 99 7/13/2020
150 100 7/14/2020
151 101 7/14/2020
152 102 7/14/2020
153 103 7/15/2020
155 105 7/16/2020
157 107 7/16/2020
158 108 7/17/2020
159 109 7/20/2020
160 110 7/21/2020
161 111 7/21/2020
162 112 7/21/2020
163 113 7/23/2020
164 114 7/24/2020
165 115 7/24/2020
166 116 7/27/2020
167 117 7/28/2020
168 118 7/28/2020
169 119 7/29/2020
170 120 7/29/2020
171 121 Daryl Radermacher 8/14/2020 darryl will instal when weather is cool enough to alow shutdown
172 122 7/29/2020
174 124 8/3/2020
175 125 8/4/2020
176 126 8/6/2020
177 127 8/7/2020
178 128 8/10/2020
179 129 8/11/2020
180 130 8/11/2020
181 131 8/11/2020
182 132 8/11/2020
183 133 8/12/2020
184 134 8/12/2020
185 135 8/13/2020
186 136 8/13/2020
289 137 12/3/2020
Pictured below is the Table Design:
Pictured below is the Relationship in the Dataset:
And pictured below is the Query used in the dataset. Query Builder runs fine.
I am just beside myself with this error. There is no duplicate data anywhere. Only RequestID and ID cannot be null. ID is auto numbered. This identical logic is also referenced in the code and those tables read and update with no problem. This is the last one, and I am not seeing it.
Thank you for the help!
- A 'Hyperactive Member' trying to make a difference in a hyperactive world! And recently, I've been promoted to a 'Finatic Member,' whatever that means!
-
Feb 10th, 2021, 05:30 PM
#2
Re: Typed Dataset cannot read database...
My guess is that the ID column has a value that no longer exists in the referenced table. I'm having a bit of trouble following which column Signoff.ID references though.
-
Feb 10th, 2021, 05:38 PM
#3
Re: Typed Dataset cannot read database...
Originally Posted by dday9
My guess is that the ID column has a value that no longer exists in the referenced table. I'm having a bit of trouble following which column Signoff.ID references though.
Who says it references anything? It should be the PKey for the table. At least that's what I'd expect it to be given the info.
-tg
-
Feb 10th, 2021, 05:47 PM
#4
Thread Starter
Fanatic Member
Re: Typed Dataset cannot read database...
There were some RequestID fields missing, but the query to just Fill the data reads...
Code:
Select RequestID, ID, Signoff, Date4, Notes FROM dbo.Signoff
This data cannot be filled...
I get the missing constraints on the relationship, but I added them in, and still the same error. Perhaps I missed one, unless anyone thinks it may be something else. To me, this is about as simple as it gets.
RequestID is an integer
ID is an autonumber integer
Signoff is a String
Date4 is a Date
Notes is a String
- A 'Hyperactive Member' trying to make a difference in a hyperactive world! And recently, I've been promoted to a 'Finatic Member,' whatever that means!
-
Feb 10th, 2021, 09:23 PM
#5
Re: Typed Dataset cannot read database...
I'm confused.
The error occurs when you try and fill DS.Completed but you show us information about the table named signoff.
Also the relation you show is for signoff and request. But that relation has no constraints.
-
Feb 11th, 2021, 10:04 AM
#6
Thread Starter
Fanatic Member
Re: Typed Dataset cannot read database...
Originally Posted by wes4dbt
I'm confused.
The error occurs when you try and fill DS.Completed but you show us information about the table named signoff.
Also the relation you show is for signoff and request. But that relation has no constraints.
The correct relation is for Signoff and Request. I pasted the wrong lines. Ironically, the Completed logic is the one that works fine. Data is now consistent between the Request and Signoff table, meaning there is the same RequestID data in both tables.
Code:
Dim ta_Signoff1 As MaintenanceRequestDataSetTableAdapters.SignoffTableAdapter = New MaintenanceRequestDataSetTableAdapters.SignoffTableAdapter
ta_Signoff1.Fill(DS.Signoff)
This is driving me crazy! Is something corrupt. Should I delete and recreate the table in my dataset?
Thanks!
- A 'Hyperactive Member' trying to make a difference in a hyperactive world! And recently, I've been promoted to a 'Finatic Member,' whatever that means!
-
Feb 11th, 2021, 01:56 PM
#7
Thread Starter
Fanatic Member
Re: Typed Dataset cannot read database...
The whole issue is fixed now.
I deleted the Signoff Table Adapter and re-created it.
I do not understand though, why this happens??
- A 'Hyperactive Member' trying to make a difference in a hyperactive world! And recently, I've been promoted to a 'Finatic Member,' whatever that means!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|