Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to edit tables in SQL Server 2008 database using C#
    primarykey
    data
    text
    <p>I am creating an application in c# which requires me to embed a database, I added a new <code>Service based Database</code> . I added it to the application, I created a table via the <code>designer</code> and added data to it. Here I started facing problems. I am able to add new records but unable to edit any rows. I noted a weird behavior.</p> <p><img src="https://i.stack.imgur.com/MqPNj.jpg" alt="enter image description here"></p> <ul> <li>When the rows are just 1 or 2, I am able to edit them without any issues.</li> </ul> <p><img src="https://i.stack.imgur.com/FG9sh.jpg" alt="enter image description here"></p> <ul> <li>But when the number of rows becomes more , say 5 of 7, I am not able to edit any rows,</li> </ul> <p>I am getting an error</p> <blockquote> <p>The row values updated or deleted either do not make the row unique or they alter multiple rows</p> </blockquote> <p><img src="https://i.stack.imgur.com/tk1OA.jpg" alt="enter image description here"></p> <p>I have neither mentioned a unique constraint nor a not null constraint. All the columns are of data type <code>text</code>. I am not sure what causes this problem. Can somebody explain me whats goin on??</p> <p>PS: and sometimes,I also get an error as seen in Screenshot 2. For such cases,when I click on <code>Execute SQL</code> , then the data is getting inserted.</p> <hr> <pre><code>***After using an Identity column, the issue is solved. Thanks a lot guys :) </code></pre> <p>Now another issue is coming up, I am able to edit in the designer but I also have a dataGridView binded to the database and I am not able to edit(update) values in it, any suggestions?? This is the code, I am using</p> <pre><code>private void saveButton_Click(object sender, EventArgs e) { this.Validate(); this.core3BindingSource.EndEdit(); this.core3TableAdapter.Update(this.coreDataSet.Core3); }*** </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload