Quote Originally Posted by Desolator144
By the way, I'm adding columns with the simplest overload because I can't figure out how the heck to write the second part for the one where it's column name then datatype. You'd think it would be System.Data.DataColumn.DataType.string like the popup window suggests but nope
I'm sorry, what? You can't work out how to specify the type when the documentation provides this code example:
Quote Originally Posted by MSDN
vb.net Code:
  1. Private Sub AddColumn()
  2.     Dim columns As DataColumnCollection = _
  3.         DataSet1.Tables("Orders").Columns
  4.  
  5.     ' Add a new column and return it.
  6.     Dim column As DataColumn = columns.Add( _
  7.         "Total", System.Type.GetType("System.Decimal"))
  8.     column.ReadOnly = True
  9.     column.Unique = False
  10. End Sub
I can only assume that that means that you didn't actually bother to read the documentation.

That said, there's a simpler way still. That code could be rewritten like this:
vb.net Code:
  1. Private Sub AddColumn()
  2.     Dim columns As DataColumnCollection = _
  3.         DataSet1.Tables("Orders").Columns
  4.  
  5.     ' Add a new column and return it.
  6.     Dim column As DataColumn = columns.Add( _
  7.         "Total", GetType(Decimal))
  8.     column.ReadOnly = True
  9.     column.Unique = False
  10. End Sub
GetType is a VB.NET operator that gets a System.Type object from a data type. A Type object is an instance of the Type class that represents a data type. In that code the data type is Decimal and GetType returns a Type object that represents that type.