none
OleDbDataAdapter.Fill(dataTable) returns a Text column values appended with "\0" RRS feed

  • Question

  • Hello,

    I am returning the DataTable form access database. Code returns me a datatable but values in text columns are appended by \0.

    e.g. In Immidiate window if I type --> dt.Rows[0][1] = "BANK\0\0"

    Why I am getting "\0\0" additional? How to avoid it?



    • Edited by Pankaj Gharge Wednesday, February 22, 2012 6:45 AM
    • Moved by Leo Liu - MSFT Thursday, February 23, 2012 8:09 AM move (From:Visual C# General)
    Wednesday, February 22, 2012 6:43 AM

Answers

  • Don't think I've ever seen that behavior before. Are you certain that these characters are not present in the text of the data in the database table?

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, February 23, 2012 8:14 PM

All replies

  • Don't think I've ever seen that behavior before. Are you certain that these characters are not present in the text of the data in the database table?

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, February 23, 2012 8:14 PM
  • Hi Pankaj,

    Try to use Watch or Console.WriteLine(). Please follow @Paul's suggestion.

    Have a nice day.


    Alan Chen[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.

    Friday, February 24, 2012 7:26 AM
    Moderator