Archive for the ‘Datatable’ Category

Specified cast is not valid in WriteXml using Dataset

This exception appears when using WriteXml of datatable or dataset. This is also caused by when you create a datatable manually and you set the “defaultvalue” to one or more datacolumn. Remove the “defaultvalue” and it will be fine.

For more information on setting defaultvalue click here

, , ,

No Comments


How to Select Records in the Datatable

To select records/items in the datatable;

  1.  
  2. Sub FilterData(dt as DataTable)
  3. Dim dRow() as Datarow
  4.  
  5. dRow = dt.select("CustomerID=10" )
  6.  
  7. Console.WriteLine("Rows " & dRow.Length)
  8.  
  9.  
  10. End Sub

, , ,

No Comments



SetPageWidth