Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
WebDataGrid - hexadecimal value 0x00, is an invalid character
posted

protected DataTable _dataTable;

 

protected void Page_Load(object sender, EventArgs e)

   {

      try

      {

       _dataTable = new DataTable();

        _dataTable.Columns.Add("PersonID", typeof(int));

        _dataTable.Columns.Add("PersonStatus", typeof(string));

 

       DataRow row = _dataTable.NewRow();

        row["PersonID"] = 1;

        row["PersonStatus"] = "\0"; // <<------------------------------------- BAD DATA!!!

        _dataTable.Rows.Add(row);

 

         myGrid.DataSource = _dataTable;

         myGrid.DataBind();

      }

      catch (Exception ex)

      {

         string err = ex.ToString();

      }

   }

The grid binding chokes on "\0";

Has anyone else experienced this?

Parents Reply Children