0

I'm developing a website using ASP.net 3.5, also I'm using MS Access 2013 for the database, in the code behind I write the following code, to get data from the db:

list = adapter.GetData().Rows.Cast<DataRow>().Select(row =>
     new Item()
     {
           ID = Convert.ToInt32(row["ID"]),
           gbName = (string)row["gbName"],
           gbLocation = (string)row["gbLocation"],
           gbBodyContent = (String)row["gbBodyContent"],
           gbDate = (string)row["gbDate"]
     }).ToList();

In the gbBodyContent I choose "Long Text" as type, but when I put a long text, I'm receiving the following exception:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Can any body explain this!?

Anthony Pegram
  • 123,721
  • 27
  • 225
  • 246
Ramzy Abourafeh
  • 1,195
  • 7
  • 17
  • 35
  • 1
    you either aren't filling out a column which is required (non-null), you are duplicating the value of a unique column, or you have a FK set up which isn't inserted into a secondary table. Its all about how your database table(s) is(are) defined and setup – Steve's a D Feb 15 '13 at 14:23
  • Perhaps this question will help: http://stackoverflow.com/questions/7026566/failed-to-enable-constraints-one-or-more-rows-contain-values-violating-non-null – Anthony Pegram Feb 15 '13 at 14:39

0 Answers0