none
Update DataSet with ListObject SetDataBinding RRS feed

  • Question

  • VS2010, Excel 2007 Add-in.

    Here's the requirement. The user get the data from DB, and save the data to the workbook. This part can be done by adding a new listobject and setting data binding to the data.

    The next part of the requirement is: The user can save the previously populated workbook. When he re-opens it, the dataset needs to be populated from the workbook itself w/o connecting to the DB again. Here's where I am stuck. I have got an empty dataset, and a few listobjects that populated with data. Every time I set the databinding between the two, the listobjects will be cleared since there's no data in the dataset.

    Is there any way to prevent this "auto refresh"? Or is there any other way to achieve the goal?

    Thanks in advance

    Tuesday, April 24, 2012 3:52 PM

All replies

  • Hi ForeignKey,

    Thanks for posting in the MSDN Forum.

    It's based on my experience you need unbinding DataSet and fill data to ListObject via code.

    I hope it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, April 27, 2012 7:14 AM
    Moderator
  • thanks for reply.

    Please be noted that I was try to load the dataset FROM the Excel table/vsto ListObject.

    What is the best practice to achieve this?

    Thanks again.

    Friday, April 27, 2012 7:39 PM
  • HI ForeigKey,

    I think I misunderstood what you said. I mean that you are able to rebrieve the range to collection the data for your dataset and do not build relationship between your dataset and ListObject.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, May 3, 2012 8:05 AM
    Moderator