none
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. binding excel data to gridview RRS feed

  • Question

  • hi,

    Can anyone help me out. I am trying to bind excel data to gridview. By using using odbcconnection with

    "SELECT * FROM [Sheet1$] " query. But i was not able to read data. i am getting the following error.

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

    

    Please help me.

    Thanks,

    Kesav

    Tuesday, July 12, 2011 8:02 AM

Answers

  • Hello,

    Thank you for posting.

    From your description, it doesn't look that your question is related to Excel worksheet or others, but DataSet. I suggest you can try to clean the datasource of DataSet and then re-bind it and try it again.

    Please feel free to let me know how it goes.

    Best Regards,


    Larcolais Gong[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, July 14, 2011 7:06 AM