locked
Datatable column not binding. RRS feed

  • Question

  • I have a database containing a column 'Form' declared as varbinary(MAX).

    It is retrieved to a datatable using a stored procedure. This  field is retrieved as a byte array.

    Then when binding this table to a dataGridView the column just disappears. Any reason? Is it beacuse it is an array?

    Will post the code if required.


    "Remember that if the world didn't suck, we'd all fall off."
    Monday, June 7, 2010 5:45 AM

Answers

All replies

  • I don't think Datagridview support binary Data directly. I think you will have to use CellFormatting event to convert your binary data into string value and then display in datagridviewCell. Or you can also create your own column which support binary data

    http://msdn.microsoft.com/en-us/library/7fb61s43.aspx


    Gaurav Khanna
    • Proposed as answer by Aland Li Monday, June 7, 2010 10:18 AM
    Monday, June 7, 2010 6:20 AM
  • Hi Chethan,

    How is the issue now? I think Khanna already indicated the key note.

    Regards,
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    Monday, June 7, 2010 10:18 AM
  • Hi Aland,

    I had made the same post in .NET BCL Section.

    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/8c2f5e65-8bfc-4eb0-b579-2a91c80ac0d8

    Got some solutions.

    I handled the byte array at the datatable itself.

    Cheers.


    "Remember that if the world didn't suck, we'd all fall off."
    • Marked as answer by Aland Li Tuesday, June 8, 2010 4:55 AM
    Monday, June 7, 2010 11:31 AM